Commit graph

41120 commits

Author SHA1 Message Date
Vincenzo Frascino
6e55fd38de doc: Update mps2_an385 documentation
This patch updates the mps2_an385 documentation adding the information
of the new added CMSDK (Cortex-M System Design Kit) Drivers.

Change-Id: I5615ebec13e8831a0360fc32cfd8be0d3ebc85b5
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-30 11:02:36 -06:00
Vincenzo Frascino
6fe2600fc5 boards: arm: mps2_an385: Enable CMSDK Drivers
This patch enables the CMSDK (Cortex-M System Design Kit) Drivers on
mps2_an385 (Cortex M3).

Change-Id: Iff51141a183ac94ad6b905acf10389ca94a451d3
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-30 11:02:36 -06:00
Vincenzo Frascino
8831a6bff1 soc: arm: mps2: Add configuration for CMSDK Driver
This patch adds the configuration parametes required to enable CMSDK
(Cortex-M System Design Kit) Drivers at MPS2 soc level.

It provides as well the definitions for the MPS2 System Control
registers.

Change-Id: I06181dcfeb4fb887425b85ec9a99c268c857a34e
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-30 11:02:36 -06:00
Maureen Helm
ec6bdd48f4 MAINTAINERS: Add frdm_kw41z board
Change-Id: Iae62702db02f6098087e8d1aa3290bae7f6ad6a2
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-30 11:02:35 -06:00
Maureen Helm
2c1e318389 frdm_kw41z: Add frdm_kw41z board
Adds initial support and documentation for the frdm_kw41z board.

- Configures the kw41 to use the 32 MHz external oscillator on the board
  to generate a 40 MHz system clock. The clock settings match the MCUX
  SDK hello_world example project.
- Provides pinmux settings for the uart, i2c, LEDs, and switches
- Enables pinmux, gpio, uart, and i2c driver instances
- Configures the fxos8700 accelerometer/magnetometer driver

Jira: ZEP-1390
Change-Id: I025a0eae3d380eaf90b02683acf5c592e2204a2e
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-30 11:02:35 -06:00
Maureen Helm
86a26fa0ae kw41z: Add kw41z SoC
Adds initial support for the kw41z SoC. This is the first SoC in the
Kinetis W (wireless connectivity) series added to Zephyr. The kw41z
integrates a 2.4 GHz radio transceiver, BLE link layer hardware, and an
802.15.4 packet processor with an ARM Cortex M0+. It has 512 KB flash,
128 KB SRAM, and can run the system clock at up to 48 MHz.

This SoC currently has mcux shim drivers for lpuart (serial), gpio,
pinmux, i2c, and flash.

Jira: ZEP-1389
Change-Id: I8cff6d203867ba3ace7e05c36441dc8f3cbca8d8
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-30 11:02:35 -06:00
Maureen Helm
8d5833ffaa k64: Rename security_frdm_k64f section
Renames the flash security section so it makes sense for other Kinetis
devices, not just k64. In Kinetis reference manuals, this section is
referred to as the 'flash configuration field'.

Change-Id: I2b7c7cc1ec2541419d77878d367d96c9ceb7a0cf
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-30 11:02:35 -06:00
Maureen Helm
e290006144 serial: Introduce new mcux lpuart shim driver
Adds a shim layer around the mcux lpuart driver to adapt it to the Zephyr
serial interface.

NXP has multiple uart hardware blocks that implement different features
and have different register maps. The k64 has a uart block called
'uart', while the kw41 has a uart block called 'lpuart' (low power
uart). The MCUXpresso SDK provides separate drivers for each type of
uart block but with similar software interfaces. As a result, there are
also separate shim drivers in Zephyr. There is a 1:1:1 relationship
between hardware block, mcux driver, and mcux shim driver.

Because we now have two mcux shim drivers for the uart interface, a new
naming convention is created:

	<interface>_mcux_<hw block>

Where <interface> is the name of the Zephyr interface, in this case
'uart'. This convention is not new.

<hw block> is the name of the NXP hardware block, in this case 'lpuart'.
This is the new part, and distinguishes different hardware blocks
for the same interface.

Change-Id: I3a80b9bffa116bbb2b02ee950d4bdd79a19a4edc
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-30 11:02:35 -06:00
Maureen Helm
ec5ee8b33d flash: Update mcux shim to new mcux version
The newer version of mcux changes its flash api slightly, so update the
Zephyr shim accordingly.

Change-Id: I0c974fc3e82b9f40372c636f0b805ed143be2198
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-30 11:02:35 -06:00
Maureen Helm
27cfd1248c mcux: Import mcux for kw41z
Imports the mcux device header files and peripheral drivers for the
kw41z and its subset devices (kw31z, kw21z). The subset devices are
included since they are released together with the kw41z by nxp, and to
avoid them getting out of sync in Zephyr if they were added later.

The kw41z shares several peripheral drivers with the k64f, so those
drivers are updated to the newer version released with the kw41z.

Origin: NXP Kinetis KW41Z Connectivity Software Linux(REV 1.0.2)
URL: https://www.nxp.com/webapp/Download?colCode=KW41Z-CONNECTIVITY-SOFTWARE-LIN&appType=license&Parent_nodeId=1441226359347708902175&Parent_pageType=product
Maintained-by: External

Jira: ZEP-1389
Change-Id: Id8e87f32b7afe01605e1e05b88addc547b2f5e21
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-30 11:02:35 -06:00
Andrew Boie
ded842ec89 Revert "Revert "sanitycheck: add support for risc v boards""
This reverts commit 9fb0c2af5c.
SDK 0.9 has now been released.

Change-Id: I676b6f0e31ab48fde3dda41b681abf53964ea9f9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-30 08:58:36 -08:00
Kumar Gala
869a9fc050 fat: match type info expected by fat library for f_write
The fat library uses its own typedef for integer parms and expects a
UINT to be either 16 or 32-bits in length.  We potentially get into
trouble when we build with newlib if we use an uint32_t.  Lets just use
unsigned int which should cover all cases for us.

Change-Id: I3dbbf4871ab65dd12488d41cb06a06387c128339
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-30 12:01:50 +00:00
Kumar Gala
97d375eead samples: webusb: fix type of bytes_read
bytes_read should be an int, all uses of it in this sample are of type
int.  Lets clean this up so when building with newlib or in the future
when uint32_t might change its definition we don't have issues.

Change-Id: Ief7bfb48948df50cec45b4707ef7676d13173f34
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-30 12:01:49 +00:00
Kumar Gala
99937a77da usb: Change transfer_len type to int32_t in usb_request_handler typedef
The functions that implement usb_request_handlers are already using an
int32_t for transfer_len, so lets make the typedef match.  This address
a potential issue in the future when the typedef of int32_t changes (or
when building with newlib).

Change-Id: I6e478551c38f2040b0dcec47c2e4c565c27acdd0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-30 12:01:49 +00:00
Kumar Gala
c9a4335ad3 samples: zperf: cleanup types for constant arrays
There are a few arrays we use with print_number and parse_number.  These
functions expect a const uint32_t so lets have the arrays for TIME_US,
KBPS, and K match.

Change-Id: I6347b06af2374d702144084bb6b538a478fb8fac
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-30 12:01:48 +00:00
David B. Kinder
f086a195ce doc: update menuconfig images in application doc
Updated main menuconfig image

Jira: ZEP-1434

Change-Id: Ib78f65868e025a45d51f1561f7e487eda0d7dbcd
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-29 13:26:50 +00:00
Anas Nashif
66417c0246 Merge "Merge net branch into master" 2017-01-29 04:31:39 +00:00
Johan Hedberg
3d2a5c38f8 Merge bluetooth branch into master
- Fixes to SPI HCI driver
 - Minor improvements, to AVDTP, A2DP, RFCOMM & HFP
 - New Kconfig variable for managing the device name

----------------------------------------------------------------
Arun Jagadish (1):
      Bluetooth: AVDTP: Add AVDTP Discover API Prototype

Jaganath Kanakkassery (3):
      Bluetooth: RFCOMM: Fix v24_signal in MSC response
      Bluetooth: RFCOMM: Implement MSC Flow Control
      Bluetooth: Doc: RFCOMM PICS file

Johan Hedberg (2):
      Bluetooth: Kconfig: Make device name variable generic
      Bluetooth: samples: Use Kconfig DEVICE_NAME variable when possible

Kumar Gala (1):
      Bluetooth: hci_raw: Make bt_buf_get_rx args consistent

Luiz Augusto von Dentz (1):
      Bluetooth: L2CAP: Only set state for dynamic channels

Piyush Itankar (2):
      Bluetooth: A2DP: Adds accept state callback handlers
      Bluetooth: A2DP: Stream End Point Structure

Ricardo Salveti (7):
      Bluetooth: SPI: fix buf handling for HCI ACL packets
      Bluetooth: SPI: fix Kconfig SPI IRQ PIN description
      Bluetooth: SPI: introduce CONFIG_BLUETOOTH_SPI_BLUENRG
      Bluetooth: SPI: fix max SPI buffer length
      Bluetooth: SPI: switch to a single SPI transfer when receiving
      Bluetooth: SPI: retry spi_transceive calls if invalid
      Bluetooth: SPI: Disable IRQ pin callback to avoid spurious IRQs

Roger Lendenmann (1):
      Bluetooth: add storage flag for secure connection pairing LTK

Sathish Narasimman (2):
      Bluetooth: AT: HFP HF: Handle unsolicited reponse
      Bluetooth: HFP HF: Handle +CIEV reponse

 doc/subsystems/bluetooth/qualification.rst      |  1 +
 doc/subsystems/bluetooth/rfcomm-pics.rst        | 51 +++++++++++++++
 drivers/bluetooth/hci/Kconfig                   | 27 ++++----
 drivers/bluetooth/hci/spi.c                     | 83 +++++++++++++++-----
 drivers/bluetooth/nble/Kconfig                  |  7 +++
 include/bluetooth/a2dp.h                        | 13 ++++
 include/bluetooth/rfcomm.h                      |  2 +-
 include/bluetooth/storage.h                     |  3 +
 samples/bluetooth/beacon/prj.conf               |  1 +
 samples/bluetooth/beacon/prj_nble.conf          |  1 +
 samples/bluetooth/beacon/src/main.c             |  2 +-
 samples/bluetooth/eddystone/prj.conf            |  1 +
 samples/bluetooth/eddystone/prj_nble.conf       |  1 +
 samples/bluetooth/eddystone/src/main.c          |  2 +-
 samples/bluetooth/gatt/ipss.c                   |  2 +-
 samples/bluetooth/handsfree/prj.conf            |  2 +-
 samples/bluetooth/ipsp/prj.conf                 |  1 +
 samples/bluetooth/peripheral/prj.conf           |  1 +
 samples/bluetooth/peripheral/prj_nble.conf      |  1 +
 samples/bluetooth/peripheral/src/main.c         |  2 +-
 samples/bluetooth/peripheral_csc/prj.conf       |  1 +
 samples/bluetooth/peripheral_csc/prj_nble.conf  |  1 +
 samples/bluetooth/peripheral_csc/src/main.c     |  2 +-
 samples/bluetooth/peripheral_dis/prj.conf       |  1 +
 samples/bluetooth/peripheral_dis/src/main.c     |  2 +-
 samples/bluetooth/peripheral_esp/prj.conf       |  1 +
 samples/bluetooth/peripheral_esp/prj_nble.conf  |  1 +
 samples/bluetooth/peripheral_esp/src/main.c     |  2 +-
 samples/bluetooth/peripheral_hids/prj.conf      |  1 +
 samples/bluetooth/peripheral_hids/prj_nble.conf |  1 +
 samples/bluetooth/peripheral_hids/src/main.c    |  2 +-
 samples/bluetooth/peripheral_hr/prj.conf        |  1 +
 samples/bluetooth/peripheral_hr/prj_nble.conf   |  1 +
 samples/bluetooth/peripheral_hr/src/main.c      |  2 +-
 samples/bluetooth/peripheral_sc_only/prj.conf   |  1 +
 samples/bluetooth/peripheral_sc_only/src/main.c |  2 +-
 subsys/bluetooth/host/Kconfig                   | 13 ++--
 subsys/bluetooth/host/a2dp.c                    | 91 +++++++++++++++++---
 subsys/bluetooth/host/a2dp_internal.h           |  6 --
 subsys/bluetooth/host/at.c                      | 35 ++++++++---
 subsys/bluetooth/host/at.h                      | 13 +++-
 subsys/bluetooth/host/avdtp.c                   | 11 ++++
 subsys/bluetooth/host/avdtp_internal.h          | 22 +++++++
 subsys/bluetooth/host/hci_core.c                |  2 +-
 subsys/bluetooth/host/hci_raw.c                 |  2 +-
 subsys/bluetooth/host/hfp_hf.c                  | 49 +++++++++++++--
 subsys/bluetooth/host/l2cap.c                   |  3 +-
 subsys/bluetooth/host/rfcomm.c                  | 50 +++++++++++----
 subsys/bluetooth/host/rfcomm_internal.h         |  2 +
 tests/bluetooth/shell/arduino_101.conf          |  2 +-
 tests/bluetooth/shell/prj.conf                  |  2 +-
 tests/bluetooth/shell/prj_br.conf               |  2 +-
 tests/bluetooth/shell/prj_nble.conf             |  1 +
 tests/bluetooth/shell/src/main.c                |  2 +-
 54 files changed, 412 insertions(+), 122 deletions(-)
 create mode 100644 doc/subsystems/bluetooth/rfcomm-pics.rst

Change-Id: Iaf3609610082865da754917d131d4bafbfbec428
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-28 08:58:41 +02:00
Ricardo Salveti
a3474a731e Bluetooth: SPI: Disable IRQ pin callback to avoid spurious IRQs
Avoid spurious IRQ when already handling the SPI Slave IRQ.

Change-Id: If8452a668bc9768d462a5fa56b851e99a076e67c
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-28 08:43:41 +02:00
Ricardo Salveti
2569e2e8d1 Bluetooth: SPI: retry spi_transceive calls if invalid
spi_transceive can return successfuly even if the data provided by the
slave is invalid, so check if the content is correct and retry until a
valid data is available.

Change-Id: Ia951de391e0b24c5b41eeabfb5c10b056d32b62e
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-28 08:43:41 +02:00
Ricardo Salveti
f27d8eef39 Bluetooth: SPI: switch to a single SPI transfer when receiving
Change-Id: I27b504032080bddf7ebc88ef4812a0e7eab691c6
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-28 08:43:41 +02:00
Ricardo Salveti
8227c72c47 Bluetooth: SPI: fix max SPI buffer length
Drop the BLUETOOTH_SPI_RX_BUFFER_SIZE and BLUETOOTH_SPI_TX_BUFFER_SIZE
config options by fixing the max SPI buffer length to 255, as used by
the X-NUCLEO-IDB04A1 BSP. This simplifies the rx/tx buffer handling, and
avoids a potential spi rx stack overflow depending on the config values
set by the user.

Change-Id: Ifa7fd086016abda4bdcf9638f28b38d001a288c5
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-28 08:43:41 +02:00
Ricardo Salveti
4afe063aad Bluetooth: SPI: introduce CONFIG_BLUETOOTH_SPI_BLUENRG
This new option is used to encapsulate the logic specific to devices
implementing the BlueNRG Bluetooth stack (e.g. X-NUCLEO-IDB05A1).

The current BlueNRG specific logic covers the HCI Reset handling and
the manual control of the SPI Chip Select line (normally not needed since
spi_transceive is also responsible for controlling the SPI CS line).

Change-Id: I5db4addf873eee0af2d957e2181c50aac53ab656
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-28 08:43:41 +02:00
Ricardo Salveti
ef7f2bd54e Bluetooth: SPI: fix Kconfig SPI IRQ PIN description
Change-Id: I4c25062e922cd05ca738222182909c261b55abca
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-28 08:43:41 +02:00
Kumar Gala
edcb6ceb12 Bluetooth: hci_raw: Make bt_buf_get_rx args consistent
The hci_raw version of bt_buf_get_rx was expecting an int for timeout.
Let us int32_t instead so we match both the hci_core version and the
type that net_buf_alloc expects.

This addresses a possible build issue if/when int32_t differs from our
default (ie, newlib).

Change-Id: I69374c48da8f2b96fa2bd418ff505fbaacda11f0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-28 08:43:41 +02:00
Johan Hedberg
eb07178236 Bluetooth: samples: Use Kconfig DEVICE_NAME variable when possible
Instead of using a hard-coded string, make the sample use the Kconfig
variable for the device name.

Change-Id: Ib09f594e1cba221f9064318572bd90d38bd2733a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-28 08:43:41 +02:00
Johan Hedberg
4153b6ca1f Bluetooth: Kconfig: Make device name variable generic
Change BREDR_NAME to DEVICE_NAME so it can also be used as the LE
device name.

Change-Id: I9ef55d9dff098372d47d9d5754ad7a7163a65bc0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-28 08:43:41 +02:00
Ricardo Salveti
e2b759bc69 Bluetooth: SPI: fix buf handling for HCI ACL packets
Code was assuming that all the HCI messages were events, causing invalid
data length when receiving HCL ACL packets.

Change-Id: I8c1a07f46b6b62a04e242cf29ee1119f59d4bda6
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-28 08:43:41 +02:00
Piyush Itankar
4a014f3e81 Bluetooth: A2DP: Stream End Point Structure
Added structure definition for stream end points
and the a2dp stream.

Change-Id: I6d0cc08611f5179397bea6200eb9244d7c1cc8d6
Signed-off-by: Piyush Itankar <piyush.t.itankar@intel.com>
2017-01-28 08:43:41 +02:00
Roger Lendenmann
785415c8ad Bluetooth: add storage flag for secure connection pairing LTK
Change-Id: I521036a7887541f4cc078283fcb400bcdd5c41ef
Signed-off-by: Roger Lendenmann <roger.lendenmann@intel.com>
2017-01-28 08:43:41 +02:00
Sathish Narasimman
730b4f89d2 Bluetooth: HFP HF: Handle +CIEV reponse
The +CIEV reponse received from the AG is handle and value is
updated to the application.

> ACL Data RX: Handle 256 flags 0x02 dlen 22         [hci0] 114.667753
      Channel: 64 len 18 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0xef poll/final 0
         Length: 14
         FCS: 0x9a
        0d 0a 2b 43 49 45 56 3a 20 32 2c 30 0d 0a 9a     ..+CIEV: 2,0...

Change-Id: I771cdb422d201293d356151fa33ec485083b2356
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-01-28 08:43:41 +02:00
Arun Jagadish
1806804ad8 Bluetooth: AVDTP: Add AVDTP Discover API Prototype
Added AVDTP Discover Request API Prototype.

Change-Id: I661331634b64099e352efe12cacc9af5d4c7ce16
Signed-off-by: Arun Jagadish <arun.jagadish@intel.com>
2017-01-28 08:43:41 +02:00
Jaganath Kanakkassery
71dbc19420 Bluetooth: Doc: RFCOMM PICS file
All mandatory and most of optional PTS tests are passing.
The only not supported optional tests are sending of Test,
RPN and RLS which is not required at the moment.

Change-Id: I5a92d30c0d44803baf6c705d86f2272e4e57fd18
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2017-01-28 08:43:41 +02:00
Luiz Augusto von Dentz
278bd910d5 Bluetooth: L2CAP: Only set state for dynamic channels
Fixed channels don't really use channels state as they don't need
connection setup.

Change-Id: Ie8b1327db0269a45e9ccb6049f8dda87aa445fb5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-28 08:43:41 +02:00
Piyush Itankar
42a175f300 Bluetooth: A2DP: Adds accept state callback handlers
Adds state callback handler to allocate memory to AVDTP on an incoming
connection. Also, abstracts searching of free session as a function call.

Change-Id: Idee6b7a0507b0b75c0007717e351ca12de0cb5be
Signed-off-by: Piyush Itankar <piyush.t.itankar@intel.com>
2017-01-28 08:43:41 +02:00
Jaganath Kanakkassery
91f9c9cf1c Bluetooth: RFCOMM: Implement MSC Flow Control
This is mainly for backward compatibility with 1.0b devices and for
spec compliance. CFC is mandatory post 1.0b spec where in MSC FC
shall not be used.

FC bit in MSC is used to manage the flow control. If FC is 1 then
the device is unable to accept frames.

Implementation is done by reusing "tx_credit" as a binary semaphore
wherein it will be blocked if MSC is recieved with FC bit 1 and
unblocked if FC bit is 0. Once tx thread is scheduled then semaphore
should be always available until all the buf in queue is sent.

Change-Id: I91181668ec0f46ff0b02905dd97e4503fc1fa7a7
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2017-01-28 08:43:41 +02:00
Jaganath Kanakkassery
17ea79e733 Bluetooth: RFCOMM: Fix v24_signal in MSC response
v24_signal in MSC response should be the copy of it received
in the command.

Change-Id: I9723ba182bf5911025c7a57220cd70687ca785f3
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2017-01-28 08:43:41 +02:00
Sathish Narasimman
d903b53e6b Bluetooth: AT: HFP HF: Handle unsolicited reponse
This implemnts the feature to handle the unsolicited response
received from the AG. In the hfp_hf.c file the unsolicited_cb function
process it.

Change-Id: I3ca6c8d4a1522d02f7160e2fe4ae1598cd93ce7e
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-01-28 08:43:41 +02:00
Bogdan Davidoaia
a45dd12f0c sensor: use SENSOR_CHAN_*_XYZ instead of SENSOR_CHAN_*_ANY
SENSOR_CHAN_*_ANY will be deprecated, so use the new SENSOR_CHAN_*_XYZ
enum values.

Change-Id: I91cf25864613a934feab65588969d10c52fd4fe6
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-27 19:07:17 +00:00
Sergio Rodriguez
fdf9238382 tests: context: Verify for out of bounds array
The for loop could exit with a out of bounds (variable j) value for
the delayed_threads array, we verify for the variable value before
operating on the array

This issue was reported by Coverity

Coverity-CID: 160078

Change-Id: I6aa1cc325cc363be48cd72b2a58d0a55ec3854bc
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-27 18:57:27 +00:00
Bogdan Davidoaia
678d1ba986 sensor: add SENSOR_CHAN_*_XYZ enum values
Add SENSOR_CHAN_*_XYZ enum values to be used instead of
SENSOR_CHAN_*_ANY, because the new naming takes into account that
they are used to fetch all the 3 axes for a channel (X, Y and Z)
and not just any number of them.

Also deprecate old SENSOR_CHAN_*_ANY enum values.

Change-Id: I59e9901c1f8879d084bdb7c95583c2b28aa1e025
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-27 17:46:18 +00:00
Kumar Gala
0ceca659e3 ext: hal: nordic: cleanup Kbuild for now
Since nothing is currently using the nordic HAL lets just stick a dummy
build line.  Once something uses it, it can add what's needed and pull
in the code that is desired.

Change-Id: Id70bb6a88c6f1bbb7f33421cd0c14aafb83597b5
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-27 08:16:44 -06:00
Jukka Rissanen
7d37e7d519 Merge net branch into master
Main changes:

- TCP fixes
- BT IPSP fixes
- Changing networking code and samples to use printk()
- CoAP over DTLS server and client samples
- Telnet console support
- IEEE 802.15.4 driver for MCR20A

----------------------------------------------------------------
Andrei Emeltchenko (8):
      wpan_serial: Queue only full packet to RX queue
      drivers: cc2520: Remove unused TI_CC2520 Kconfig option
      net: Remove CONFIG_NET_IPV6_NO_ND config option
      net: tests: Correct project file for route tests
      net: Make NET_IPV6_ND configurable option
      net: Make NET_IPV6_DAD depends on NET_IPV6_ND
      net: Remove unused CONFIG_NET_IPV6_NO_DAD option
      net: Fix leaving NET_MAX_6LO_CONTEXTS set when 6lowpan deselected

Andy Ross (2):
      net: tcp: Make the connect callback on success, not transmission
      net: tcp: Issue connection callback on RST

Johann F (2):
      ext: mcux: add MCR20Overwrites.h
      samples: ieee802154: add MCR20A

Johann Fischer (3):
      drivers: ieee802154: add MCR20A driver
      boards: frdm_k64f: add pinmux settings for MCR20A
      samples: net: add configs for MCR20A

Jukka Rissanen (2):
      net: tcp: Only return -ETIMEDOUT if timeout>0 in connect
      net: echo-client: Add TCP support

Luiz Augusto von Dentz (3):
      net: bt: Fix not checking channel state
      net: bt: Fix warning when compiling without debug
      net: bt: Fix not checking for valid ll addresses

Malcolm Prinn (1):
      net: iface: Fix typo in net_if_down

Paul Sokolovsky (1):
      net: Set default NET_NBUF_RX_COUNT to 4.

Ravi kumar Veeramally (12):
      samples: net: Add DHCPv4 sample application README file
      net: tests: Fix invalid config option in 6lo tests
      net: Fix 80 line character limit
      net: Use lighter printk() instead of printf()
      net: samples: Use lighter printk() instead of printf()
      net: tests: Use lighter printk() instead of printf()
      net: samples: Fix config option
      doc: net: Fix networking documentation
      net: ip: Check error conditions and return false
      net: 6lo: Verify src and dst link layer addresses
      net: dhcpv4: Fix tiny style issues
      net: 6lo: Fix tiny style issues

Sergio Rodriguez (2):
      samples/coaps_server CoAP over DTLS server example app using mbedTLS
      samples/coaps_client CoAP over DTLS client example app using mbedTLS

Tomasz Bursztyka (18):
      drivers/console: Removing non existing Kconfig source
      misc/printk: Add a function to get the current hook function.
      net: ip: Add a useful macro to staticaly initialize a struct in_addr
      drivers/console: Add a basic telnet console
      samples/net: Add telnet console support on echo_server with qemu
      shell: Fix tiny style issues
      drivers/uart_console: Fix tiny style issues
      drivers/console: Making console input generic
      console/shell: Switch to generic console input
      shell: Make the command queue size configurable via Kconfig
      drivers/console/telnet: Provide minimal input handling.
      shell: If enabled, let's register telnet console as an input
      drivers/console/telnet: Add ground support for telnet commands
      net/ieee802154: Modify radio TX function signature
      net/ieee802154: Raise an error when data frame cannot be created
      net/6lo: Switch to NET_ERR/NET_WARN when relevant.
      net/shell: Fix format string
      drivers/console/telnet: Select TCP when telnet is selected

Vinicius Costa Gomes (2):
      samples/zoap: Update zoap samples documentation
      samples/zoap_server: Also listen on the unicast address

 boards/arm/frdm_k64f/pinmux.c                      |    7 +
 .../networking/ip-stack-architecture.rst           |   12 +-
 doc/subsystems/networking/networking.rst           |    3 +-
 drivers/console/Kconfig                            |   10 +-
 drivers/console/Kconfig.telnet                     |  124 ++
 drivers/console/Makefile                           |    1 +
 drivers/console/telnet_console.c                   |  558 ++++++++
 drivers/console/telnet_protocol.h                  |  125 ++
 drivers/console/uart_console.c                     |   17 +-
 drivers/ieee802154/Kconfig                         |  125 +-
 drivers/ieee802154/Makefile                        |    2 +
 drivers/ieee802154/ieee802154_cc2520.c             |   32 +-
 drivers/ieee802154/ieee802154_mcr20a.c             | 1462 ++++++++++++++++++++
 drivers/ieee802154/ieee802154_mcr20a.h             |  184 +++
 drivers/ieee802154/ieee802154_mcr20a_regs.h        |  590 ++++++++
 drivers/ieee802154/ieee802154_uart_pipe.c          |   10 +-
 ext/hal/nxp/mcux/Makefile                          |    4 +
 ext/hal/nxp/mcux/README                            |    8 +
 .../nxp/mcux/components/mcr20a/MCR20Overwrites.h   |  309 +++++
 ext/lib/crypto/mbedtls/configs/config-coap.h       |  102 ++
 include/drivers/console/console.h                  |   49 +
 include/drivers/console/telnet_console.h           |   37 +
 include/drivers/console/uart_console.h             |    6 -
 include/net/ieee802154_radio.h                     |    6 +-
 include/net/net_context.h                          |   37 +-
 include/net/net_ip.h                               |    5 +
 misc/printk.c                                      |   13 +
 samples/net/coaps_client/Makefile                  |   14 +
 samples/net/coaps_client/README.rst                |   53 +
 samples/net/coaps_client/prj_qemu_x86.conf         |   27 +
 samples/net/coaps_client/src/Makefile              |    7 +
 samples/net/coaps_client/src/coaps_client.c        |  447 ++++++
 samples/net/coaps_client/src/udp.c                 |  202 +++
 samples/net/coaps_client/src/udp.h                 |   23 +
 samples/net/coaps_client/src/udp_cfg.h             |   21 +
 samples/net/coaps_client/testcase.ini              |    4 +
 samples/net/coaps_server/Makefile                  |   14 +
 samples/net/coaps_server/README.rst                |   76 +
 samples/net/coaps_server/prj_qemu_x86.conf         |   30 +
 samples/net/coaps_server/src/Makefile              |    7 +
 samples/net/coaps_server/src/coaps_server.c        |  685 +++++++++
 samples/net/coaps_server/src/udp.c                 |  186 +++
 samples/net/coaps_server/src/udp.h                 |   24 +
 samples/net/coaps_server/src/udp_cfg.h             |   20 +
 samples/net/coaps_server/testcase.ini              |    4 +
 samples/net/dhcpv4_client/README.rst               |  161 +++
 samples/net/dns_client/prj_qemu_x86.conf           |    2 +-
 samples/net/echo_client/prj_frdm_k64f_mcr20a.conf  |   48 +
 samples/net/echo_client/src/Makefile               |    4 +
 samples/net/echo_client/src/echo-client.c          |  516 +++++--
 samples/net/echo_server/prj_cc2520.conf            |    2 -
 samples/net/echo_server/prj_frdm_k64f_mcr20a.conf  |   46 +
 samples/net/echo_server/prj_slip.conf              |   12 +-
 samples/net/echo_server/src/echo-server.c          |    5 +-
 samples/net/ieee802154/hw/prj.conf                 |    2 -
 samples/net/ieee802154/hw/prj_mcr20a.conf          |   45 +
 samples/net/ieee802154/hw/src/ieee802154_test.c    |   13 +-
 samples/net/ieee802154/qemu/prj.conf               |    2 -
 samples/net/leds_demo/src/leds-demo.c              |    5 +-
 samples/net/mbedtls_dtlsclient/prj_qemu_x86.conf   |    2 +-
 samples/net/mbedtls_dtlsserver/prj_qemu_x86.conf   |    2 +-
 samples/net/wpan_serial/src/main.c                 |   36 +-
 samples/net/wpanusb/src/wpanusb.c                  |   18 +-
 samples/net/zoap_client/README.rst                 |   46 +
 samples/net/zoap_client/README.txt                 |   54 -
 samples/net/zoap_client/src/zoap-client.c          |   34 +-
 samples/net/zoap_server/README.rst                 |   40 +
 samples/net/zoap_server/README.txt                 |   51 -
 samples/net/zoap_server/src/zoap-server.c          |   33 +-
 subsys/net/ip/6lo.c                                |   77 +-
 subsys/net/ip/Kconfig                              |    3 +-
 subsys/net/ip/Kconfig.ipv6                         |    7 +-
 subsys/net/ip/connection.c                         |   20 +-
 subsys/net/ip/dhcpv4.c                             |   41 +-
 subsys/net/ip/icmpv4.c                             |    8 +-
 subsys/net/ip/icmpv6.c                             |    8 +-
 subsys/net/ip/ipv6.c                               |   13 +-
 subsys/net/ip/l2/arp.c                             |    2 +-
 subsys/net/ip/l2/bluetooth.c                       |   27 +-
 subsys/net/ip/l2/ethernet.c                        |    2 +-
 subsys/net/ip/l2/ieee802154/ieee802154.c           |   18 +-
 subsys/net/ip/l2/ieee802154/ieee802154_frame.c     |    1 +
 .../net/ip/l2/ieee802154/ieee802154_radio_aloha.c  |    7 +-
 .../ip/l2/ieee802154/ieee802154_radio_csma_ca.c    |    7 +-
 .../net/ip/l2/ieee802154/ieee802154_radio_utils.h  |    7 +-
 subsys/net/ip/net_context.c                        |   23 +-
 subsys/net/ip/net_core.c                           |    6 +-
 subsys/net/ip/net_if.c                             |    2 +-
 subsys/net/ip/net_private.h                        |   15 +-
 subsys/net/ip/net_shell.c                          |    4 +-
 subsys/net/ip/route.c                              |    4 +-
 subsys/net/ip/rpl-of0.c                            |    2 +-
 subsys/net/ip/rpl.c                                |   13 +-
 subsys/shell/Kconfig                               |   11 +-
 subsys/shell/shell.c                               |   41 +-
 tests/net/6lo/prj.conf                             |    2 +-
 tests/net/arp/src/main.c                           |   12 +-
 tests/net/ieee802154/l2/prj.conf                   |    2 -
 .../net/ieee802154/l2/src/ieee802154_fake_driver.c |    4 +-
 tests/net/ip-addr/src/main.c                       |   11 +-
 tests/net/nbuf/src/main.c                          |   11 +-
 tests/net/route/prj.conf                           |   11 -
 tests/net/tcp/prj.conf                             |    1 -
 tests/net/udp/prj.conf                             |    1 -
 104 files changed, 6726 insertions(+), 559 deletions(-)
 create mode 100644 drivers/console/Kconfig.telnet
 create mode 100644 drivers/console/telnet_console.c
 create mode 100644 drivers/console/telnet_protocol.h
 create mode 100644 drivers/ieee802154/ieee802154_mcr20a.c
 create mode 100644 drivers/ieee802154/ieee802154_mcr20a.h
 create mode 100644 drivers/ieee802154/ieee802154_mcr20a_regs.h
 create mode 100644 ext/hal/nxp/mcux/components/mcr20a/MCR20Overwrites.h
 create mode 100644 ext/lib/crypto/mbedtls/configs/config-coap.h
 create mode 100644 include/drivers/console/console.h
 create mode 100644 include/drivers/console/telnet_console.h
 create mode 100644 samples/net/coaps_client/Makefile
 create mode 100644 samples/net/coaps_client/README.rst
 create mode 100644 samples/net/coaps_client/prj_qemu_x86.conf
 create mode 100644 samples/net/coaps_client/src/Makefile
 create mode 100644 samples/net/coaps_client/src/coaps_client.c
 create mode 100644 samples/net/coaps_client/src/udp.c
 create mode 100644 samples/net/coaps_client/src/udp.h
 create mode 100644 samples/net/coaps_client/src/udp_cfg.h
 create mode 100644 samples/net/coaps_client/testcase.ini
 create mode 100644 samples/net/coaps_server/Makefile
 create mode 100644 samples/net/coaps_server/README.rst
 create mode 100644 samples/net/coaps_server/prj_qemu_x86.conf
 create mode 100644 samples/net/coaps_server/src/Makefile
 create mode 100644 samples/net/coaps_server/src/coaps_server.c
 create mode 100644 samples/net/coaps_server/src/udp.c
 create mode 100644 samples/net/coaps_server/src/udp.h
 create mode 100644 samples/net/coaps_server/src/udp_cfg.h
 create mode 100644 samples/net/coaps_server/testcase.ini
 create mode 100644 samples/net/dhcpv4_client/README.rst
 create mode 100644 samples/net/echo_client/prj_frdm_k64f_mcr20a.conf
 create mode 100644 samples/net/echo_server/prj_frdm_k64f_mcr20a.conf
 create mode 100644 samples/net/ieee802154/hw/prj_mcr20a.conf
 create mode 100644 samples/net/zoap_client/README.rst
 delete mode 100644 samples/net/zoap_client/README.txt
 create mode 100644 samples/net/zoap_server/README.rst
 delete mode 100644 samples/net/zoap_server/README.txt

Change-Id: I6caced9d0ae41d2019fb30434141260471e2538e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-27 16:05:40 +02:00
Carles Cufi
17f7b4ed95 ext: Integrate Nordic SDK HAL files into Zephyr
Nordic Semiconductor's Software Development Kit's HAL layer
provides a set of low-level header and sourcefiles that give access
to the different hardware peripherals of Nordic ICs.

This patch includes the new files in the build and refactors the Kconfig
and Kbuild files in ext/hal/nordic to acommodate for the presence of the
new HAL layer.

Change-Id: Ie8e1a4c9fcc7e9058a9d16a2692ef1789603aa53
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-27 14:44:19 +01:00
Carles Cufi
ed9ffc3a99 ext: Import Nordic SDK HAL files
Nordic Semiconductor's Software Development Kit's HAL layer
provides a set of low-level header and sourcefiles that give access to
the different hardware peripherals of Nordic ICs.

Origin: Nordic SDK 12.2.0 (components/drivers_nrf/hal)
URL: http://developer.nordicsemi.com/nRF5_SDK/
License: 3-clause BSD
Maintained-by: External

Change-Id: Iafb5816af89461c8e88ba3b47e790cb6141d10fe
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-27 14:42:51 +01:00
Jukka Rissanen
7ad52b94cf net: echo-client: Add TCP support
This commit enables echo-client application to start to
send data over TCP connection.

Change-Id: I9acdaae7f1e8411952c30caeedc9c1fb07cdd448
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-27 15:06:06 +02:00
Tomasz Bursztyka
028896063f drivers/console/telnet: Select TCP when telnet is selected
Thus users won't have to first enable network stack and then telnet.

Change-Id: I30cb2b9debee3feaf804f9a70f9d3f90758f5f17
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 13:02:11 +00:00
Andrei Emeltchenko
6580644449 net: Fix leaving NET_MAX_6LO_CONTEXTS set when 6lowpan deselected
Make NET_MAX_6LO_CONTEXTS depends on NET_6LO_CONTEXT, otherwise at the
moment even deselecting 6lowpan leaves NET_MAX_6LO_CONTEXTS set.

Change-Id: Iaa34d324005817be05190e203f6899ab89f89e5d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 11:59:31 +00:00
Tomasz Bursztyka
1e0fdd37ab net/shell: Fix format string
Change-Id: Id335466e68add23a5786257681dc1b4d5bf6846d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 11:49:42 +01:00
Andrei Emeltchenko
6043dddd4a net: Remove unused CONFIG_NET_IPV6_NO_DAD option
Option CONFIG_NET_IPV6_NO_DAD is not used anymore, clean project
configuration files.

Change-Id: I368e076d2f79f1d4bc86edee11ff5befe37362c8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:54 +02:00