Commit graph

41120 commits

Author SHA1 Message Date
Marcus Shawcroft
53f0823113 net/dhcpv4: Call net_if_ipv4_addr_rm
The DHCPv4 client obtains resources from the server on a lease.  Once
a lease expires those resources must be relinquished.

Update the DHCPv4 client to explicitly remove leased resources from
the network stack once a lease has expired.

Change-Id: I5d3b7a02e463041cfdee1d104f5962498bdd6a30
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:41 +02:00
Marcus Shawcroft
3726bb98bd net/dhcpv4: Introduce start/stop API and disabled state.
Change-Id: Iae3b96dd91325ecf51b33b8c58f65aa5ec2b40c9
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:41 +02:00
Marcus Shawcroft
c4f4cb17db net/dhcpv4: Rework initialization.
The existing dhcpv4 initialization code places all initialization in
the per iface dhcpv4_start() code.  The net_udp_register() setup needs
to happen once for the dhcpv4 instance rather than once per iface.
Subsequent patches in this series also need a place to perform one
time initialization, independent of iface.

Factor the one time setup code out of the existing net_dhcpv4_start()
into a dhcpv4_init() function.  Rather than use SYS_INIT() to run
dhcpv_init() we hook directly into net_init().

The prototype of dhcpv4_init() is shared within the net subsystem with
a new private header file deliberately to avoid exposing the function
via the public API in include/net/dhcpv4.h

Change-Id: I3502a53cc3bfe4db4e4cd22c02ae133c266fdf10
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:41 +02:00
Marcus Shawcroft
010102ae02 net/dhcpv4: Refactor REQUESTING state entry.
Factor out common code associated with entering the REQUESTING state.

Change-Id: I0fc038a49309625c24b874dfda0355794cd41da9
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:41 +02:00
Marcus Shawcroft
653d614e1e net/dhcpv4: Refactor SELECTING state entry.
Factor out common code associated with entering the SELECTING state.

Change-Id: If34929e5f13dff7650388a2b491a01cbbf5dc100
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:41 +02:00
Marcus Shawcroft
5cfc917617 net/dhcpv4: Refactor send_discover
Refactor send_discover() to provide a clean separation between state
machine and action.

Change-Id: I96510cc6a7ab16216821fe65ea4289a78f6443aa
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:41 +02:00
Marcus Shawcroft
33bb4c0f21 net/dhcpv4: Refactor send_request state handling.
Refactor send_request() to provide a clean separation between state
machine and action.

Change-Id: If4c61c5789c919ab3ce6c1f914afc243176760d8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:41 +02:00
Marcus Shawcroft
81c0d5fb3d net/dhcpv4: Explicitly initialize net_if dhcpv4 state.
Change-Id: I1ded49223f3b19ae26eb8cd346d00121bfb6721b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:41 +02:00
Marcus Shawcroft
9dd39e1553 net/dhcpv4: Implement NAK support.
Handle the NAK message.

Change-Id: Ia3686564b083b16bd409bbe39acc500404f90fe0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:41 +02:00
Marcus Shawcroft
57b24721b2 net/dhcpv4: Refactor handle_reply()
Split handle_reply into distinct state machine and actions.

Change-Id: Ib177c7a4007662f941f156acfa5791e1d27e3d73
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:41 +02:00
Marcus Shawcroft
b840664c11 net/dhcpv4: Adjust state names to reflect rfc2131
The dhcpv4 state machine implementation names differ from the names
used by the relevant rfc.  There is no good reason for them to be
different, so rename them.

Change-Id: I837f1bc4788c0ed4d2949b12eb6f5bfeef9a0be8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:40 +02:00
Marcus Shawcroft
1f279e13b3 net/dhcpv4: Unify dhcpv4 state name printers
There are two implementations of dhcpv4 state name numbers to human
readable strings, unify the two.

Change-Id: I1d654918bb919108a0d8c5514b309b193c9c3f96
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:40 +02:00
Marcus Shawcroft
8df38dc55f net/dhcpv4: Move timers inside the net_if dhcpv4 context
The dhcpv4 state machine has a dedicated context within each net_if
structure.  For reasons unknown the timers used by the dhcpv4 state
machine have been placed in net_if outside of the dhcpv4 context area.
Relocate them into the dhcpv4 context.

Change-Id: I0531f493610dffda9ca9208993597a5665bde997
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:40 +02:00
Marcus Shawcroft
5dcc56ebed net/dhcpv4: Refactor dhcpv4 message type representation.
Change the message type representation from integer to enum, this will
help prevent re-occurrence of recent issues where states and events
are interchanged by making it more likely the compiler will see a type
mismatch.

Change-Id: Ia235afda428a9e5dfbd933e02beeae468b4c84a2
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:40 +02:00
Marcus Shawcroft
0d0cdc23a6 net/dhcpv4: Refactor packet construction
Refactor and simplify packet construction.  This resulting code is
simplier, easier to read and compiles a lot smaller.

Change-Id: I43c67d79fbb77f85af54355eca41f516054cbba3
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:40 +02:00
Marcus Shawcroft
1559a3b3e8 net/dhcpv4: Add missing const
Change-Id: I213b35936eb862d5abc4356a1a920cc2fef02f3f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:40 +02:00
Jesus Sanchez-Palencia
b21cfc2404 net: context: Make packet_received() static
This function is used only within net_context.c, make the symbol static
then.

Change-Id: Ib2c00a21c25e8c6a1404d6345d4b8ae05b779525
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2017-03-09 20:33:40 +02:00
Vinicius Costa Gomes
8f409f28b4 lib/zoap: Fix warning about signedness conversion
'query->value' is a 'const uint8_t *' so it should be casted to a
char (signed) array before it is used in places where a 'char *'
is expected, strncmp() is an example.

Jira: ZEP-1810

Change-Id: I94cf780a40ad5fed29607d2302dc7a10387bb86f
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-03-09 20:33:40 +02:00
Leandro Pereira
4a0e008e8d net: tcp: ACK packet should not be forwarded to application
Since we try to match with POSIX behavior as much as possible, let's
not bother the user unless they need to be bothered.  The recv(2) POSIX
syscall won't return 0 on stream sockets unless the connection has been
closed by the peer; however, that was happening with the callback set
by net_context_recv().

Change it so that the callback is never called if operating on a stream
socket and appdatalen is set to 0.

This is similar to a previous patch sent by Michael Scott in [1], but
not relying on the actual TCP flags: only on the appdatalen and the
socket type.

[1] https://gerrit.zephyrproject.org/r/#/c/9949/

Jira: ZEP-1632

Change-Id: Ib0c214fc9269d305a03e8d85eb606f106c45b038
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-09 20:33:40 +02:00
Sergio Rodriguez
ee8bfe586b samples: mbedtls: Fixing entropy source
Using a more efficent entropy call and proper output data

Change-Id: I2ce71f63b6f22e5ceda79babd2eac802fa4bdf53
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-09 20:33:40 +02:00
Anas Nashif
e5d1d18415 quark_se_ss: disable x86 GPIO driver by default
Change-Id: Iba35765b1500241fef62f947343ae40a16e6c443
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-09 14:53:17 +01:00
Souvik K Chakravarty
f98cb40179 soc: defconfig: Enable WDT for ATMEL SAM MCUs
In Atmel SAM Family of MCUs, the watchdog is enabled by default at boot.
The watchdog once disabled, cannot be re-enabled back without a reset.
Hence disabling the Watchdog needs to be handled via the Watchdog driver.

Tested on Atmel SAMV71 Xplained Ultra Evaluation Kit.

Jira: ZEP-1684

Change-Id: I5682c3f007a846b064b8d16abf0d9b67d4c8e7d6
Signed-off-by: Souvik K Chakravarty <souvik.k.chakravarty@intel.com>
2017-03-09 13:43:18 +00:00
Souvik K Chakravarty
8fa2f82524 watchdog: Add WDT driver for Atmel SAM SoCs
Basic Watchdog driver for Atmel SAM family MCUs. Currently only
disabling the watchdog is supported.

Tested on Atmel SAMV71 Xplained Ultra Evaluation Kit.

Origin: Original

Jira: ZEP-1684

Change-Id: I8f717c7f53aa290c944b7935e0570c2a6f53956e
Signed-off-by: Souvik K Chakravarty <souvik.k.chakravarty@intel.com>
2017-03-09 13:43:17 +00:00
Anas Nashif
b08d655286 quark_se: do not enable x86 SPI on ARC
Change-Id: I0583a181fc59ec14f8dbad62722f58a3c7d03390
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-09 10:05:38 +00:00
Kumar Gala
945517205f Revert "build: Fix qemugdb target"
This reverts commit 370571b563 which
breaks the build in weird ways since we end up some times include
Makefile bits multiple times and getting unexpected behavior.  Its also
not clear if this actually fixes the issue with make qemugdb target work
again.

Change-Id: I1a04881daabc0a37651906a42b1bf1fb27f9411f
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-03-09 09:22:51 +00:00
Johan Hedberg
69d9985429 Merge bluetooth branch into master
- Assert fixes to controller state transitions
 - AVDTP fixes & improvements
 - SDP fixes & improvements
 - HFP improvements
 - GATT fixes
 - New GATT API for getting current MTU

----------------------------------------------------------------
Arun Jagadish (3):
      Bluetooth: AVDTP: Add AVDTP Receive Function
      Bluetooth: AVDTP: Fix discover param struct
      Bluetooth: AVDTP: Rename of variables

Carles Cufi (4):
      Bluetooth: controller: Use direct ISRs
      Bluetooth: controller: Set debug pins with macros
      Bluetooth: controller: Introduce debug pins Kconfig option
      Bluetooth: controller: Report 5.0 compliant controller

Jaganath Kanakkassery (1):
      Bluetooth: SDP: Server: Introduce private define for max services

Johan Hedberg (3):
      Bluetooth: Add support for Bluetooth 5.0 version specifier
      Bluetooth: Relax minimum advertising interval for 5.0 controllers
      Bluetooth: samples: Add combined observer & broadcaster app

Kaustav Dey Biswas (5):
      Bluetooth: SDP: Server: Fix MTU setting after l2cap connection
      Bluetooth: SDP: Server: Set security level to NONE
      Bluetooth: SDP: Server: Refactor data element structure header
      Bluetooth: SDP: Server: Handle Service Search request
      Bluetooth: SDP: Server: Filter records based on requested uuids

Luiz Augusto von Dentz (4):
      Bluetooth: GATT: Use __ASSERT for invalid parameters
      Bluetooth: GATT: Add bt_gatt_get_mtu API
      Bluetooth: L2CAP: Move functions in preparation for queuing
      Bluetooth: L2CAP: Add TX queueing for LE CoC

Maureen Helm (1):
      Bluetooth: samples: Add hexiwear_k64 and frdm_k64f to tests

Piyush Itankar (2):
      Bluetooth: A2DP: Stream End Point Registration
      Bluetooth: A2DP: Added Preset Structure

Sathish Narasimman (4):
      Bluetooth: AT: Fix 'signed' warning
      Bluetooth: HFP HF: Handling AG Network error
      Bluetooth: HFP HF: SCO: Add esco supported pkt type
      Bluetooth: HFP HF: SCO: Accept eSCO conn request

Szymon Janc (9):
      Bluetooth: shell: Fix accessing invalid memory
      Bluetooth: shell: Fix typo
      Bluetooth: SMP: Fix passkey entry for legacy pairing
      Bluetooth: shell: Don't echo LE CoC data
      Bluetooth: Fix connection object leak
      Bluetooth: shell: Simplify indication in gatt-subscribe
      Bluetooth: shell: Fix GATT long write support
      Bluetooth: GATT: Remove not needed variable
      Bluetooth: GATT: Fix subscriptions removal

Vinayak Chettimada (6):
      Bluetooth: Controller: Use direct ISR for Radio IRQ only
      Bluetooth: Controller: Fix LE Ping PDU dispatch
      Bluetooth: Controller: Run all enqueued mayfly before disable
      Bluetooth: Controller: Kconfig option to set public address
      Bluetooth: Controller: Fix assert on role stop/abort
      Bluetooth: Controller: mayfly enable to supercede over disable

 include/bluetooth/a2dp-codec.h               |  73 +++++
 include/bluetooth/a2dp.h                     |  61 +++++
 include/bluetooth/conn.h                     |   2 +
 include/bluetooth/gatt.h                     |  11 +
 include/bluetooth/hci.h                      |  50 ++++
 include/bluetooth/l2cap.h                    |   4 +
 include/bluetooth/sdp.h                      | 103 ++++---
 samples/bluetooth/peripheral_hr/testcase.ini |   2 +-
 samples/bluetooth/scan_adv/Makefile          |   5 +
 samples/bluetooth/scan_adv/README.rst        |  25 ++
 samples/bluetooth/scan_adv/prj.conf          |   2 +
 samples/bluetooth/scan_adv/src/Makefile      |   1 +
 samples/bluetooth/scan_adv/src/main.c        |  75 +++++
 samples/bluetooth/scan_adv/testcase.ini      |   4 +
 subsys/bluetooth/controller/Kconfig          |  15 +
 subsys/bluetooth/controller/hal/debug.h      | 124 ++++-----
 subsys/bluetooth/controller/hal/nrf5/radio.c |   4 +-
 subsys/bluetooth/controller/hal/radio.h      |   2 +-
 subsys/bluetooth/controller/hci/hci.c        |   2 +-
 subsys/bluetooth/controller/hci/hci_driver.c |  22 +-
 subsys/bluetooth/controller/ll/ctrl.c        | 229 ++++++++++++----
 subsys/bluetooth/controller/util/mayfly.c    |  58 +++-
 subsys/bluetooth/controller/util/mayfly.h    |   4 +-
 subsys/bluetooth/host/Kconfig                |   9 +
 subsys/bluetooth/host/a2dp.c                 |  19 ++
 subsys/bluetooth/host/at.c                   |  53 +++-
 subsys/bluetooth/host/at.h                   |  38 ++-
 subsys/bluetooth/host/avdtp.c                |  63 ++++-
 subsys/bluetooth/host/avdtp_internal.h       |  14 +-
 subsys/bluetooth/host/conn.c                 |  60 +++-
 subsys/bluetooth/host/conn_internal.h        |  10 +
 subsys/bluetooth/host/gatt.c                 |  86 +++---
 subsys/bluetooth/host/hci_core.c             |  92 ++++++-
 subsys/bluetooth/host/hci_core.h             |   8 +
 subsys/bluetooth/host/hfp_hf.c               |  15 +-
 subsys/bluetooth/host/l2cap.c                | 319 +++++++++++++---------
 subsys/bluetooth/host/sdp.c                  | 391 +++++++++++++++++++++++++--
 subsys/bluetooth/host/sdp_internal.h         |   2 +
 subsys/bluetooth/host/smp.c                  |   1 -
 tests/bluetooth/shell/src/main.c             |  98 ++++---
 40 files changed, 1728 insertions(+), 428 deletions(-)
 create mode 100644 include/bluetooth/a2dp-codec.h
 create mode 100644 samples/bluetooth/scan_adv/Makefile
 create mode 100644 samples/bluetooth/scan_adv/README.rst
 create mode 100644 samples/bluetooth/scan_adv/prj.conf
 create mode 100644 samples/bluetooth/scan_adv/src/Makefile
 create mode 100644 samples/bluetooth/scan_adv/src/main.c
 create mode 100644 samples/bluetooth/scan_adv/testcase.ini

Change-Id: I94f2f9f4431e21da9aae00c9e32581acb383ad49
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-08 22:21:41 +01:00
Sathish Narasimman
e51a19fdc2 Bluetooth: HFP HF: SCO: Accept eSCO conn request
1. Accept the incoming Synchronous connection request and establish
a new sco connection object.
2. Enable sco conn complete in event_mask

> HCI Event: Connect Request (0x04) plen 10           [hci0] 126.198264
        Address: 48:9D:24:1F:4D:1D (BlackBerry RTS)
        Class: 0x7a020c
          Major class: Phone (cellular, cordless, payphone, modem)
          Minor class: Smart phone
          Networking (LAN, Ad hoc)
          Capturing (Scanner, Microphone)
          Object Transfer (v-Inbox, v-Folder)
          Audio (Speaker, Microphone, Headset)
          Telephony (Cordless telephony, Modem, Headset)
        Link type: eSCO (0x02)
< HCI Command: Accept Synchronous Co.. (0x01|0x0029) plen 21
        Address: 48:9D:24:1F:4D:1D (BlackBerry RTS)
        Transmit bandwidth: 8000
        Receive bandwidth: 8000
        Max latency: 7
        Setting: 0x0060
          Input Coding: Linear
          Input Data Format: 2's complement
          Input Sample Size: 16-bit
          # of bits padding at MSB: 0
          Air Coding Format: CVSD
        Retransmission effort: Optimize for power consumption (0x01)
        Packet type: 0x0006
          HV2 may be used
          HV3 may be used
> HCI Event: Command Status (0x0f) plen 4           [hci0] 126.205171
      Accept Synchronous Connection Request (0x01|0x0029) ncmd 1
        Status: Success (0x00)

Change-Id: I71597aef94e945a9c07be1960994ad20c1b44bb3
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-03-08 15:35:28 +00:00
Sathish Narasimman
5490c80383 Bluetooth: HFP HF: SCO: Add esco supported pkt type
From the response of read_local_supported_feaatures check if local
device supports eSCO packet type and update it to bt_dev.
Also added sco field in bt_dev

Change-Id: If85b3d24d327a6243318fad89a07375a8253f89b
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-03-08 15:35:06 +00:00
Sathish Narasimman
83bb08fbd9 Bluetooth: HFP HF: Handling AG Network error
This patch includes handling AG network error i.e +CME ERROR and
report the error number.

Change-Id: I19a3158e44568ad0ad21fb0dd790ac2f554c0625
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-03-08 15:34:31 +00:00
Sathish Narasimman
1d44e345be Bluetooth: AT: Fix 'signed' warning
Jira: ZEP-1857

Change-Id: Ie9647048544442a004f9b55e3ae889f472b08281
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-03-08 15:34:08 +00:00
Vinayak Chettimada
16608e9a51 Bluetooth: Controller: mayfly enable to supercede over disable
If mayfly enable is called before mayfly could be disabled,
then enable shall supercede disabling, the mayfly will
remain enabled. Any new mayfly enqueued by the caller that
tried to disable mayfly will be chain for deferred
executon under this condition.

The BLE Controller's connection update procedure broke when
mayfly implementation was updated to defer disabling until
all queued mayfly where completed. Mayfly is disabled
between ticker_stop and ticker_start calls to chain them
so that ticker does not power off counter h/w if the ticker
being stopped is last one.

This commit fixes the connection update procedure which
used the mayfly enable before mayfly disable could
complete.

Jira: ZEP-1839

Change-id: I07d34c90d193b5eca9762acd8b7272e8d7a78474
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-08 15:14:32 +00:00
Vinayak Chettimada
ecc0f83d92 Bluetooth: Controller: Fix assert on role stop/abort
Call to ticker_stop/update can fail under the condition
where in a role is being stopped but at the same time it is
preempted by the role event that also uses ticker_stop/
update.

Also if a role closes graceful while it is being stopped,
the radio ISR will process the stop state with no active
role at that instance in time. In this case just reset the
state to none, the role has already been gracefully closed
before this ISR execution. The above applies to aborting a
role event too.

This commit adds code to detect these conditions and
deterministically recover from it.

This commit fixes the assert observed while stopping
advertiser in the Bluetooth sample scan_adv.

Jira: ZEP-1852

Change-id: I51c8d6e212ef43e3526a199cf7b666a79729c732
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-08 15:14:22 +00:00
Paul Sokolovsky
0c6df2d55c include/zephyr.h: Define __ZEPHYR__ if not already.
__ZEPHYR__ preprocessor macro is a way for a (cross-platform)
application to test if it's built for Zephyr. Currently it's defined
by Makefile, so if an app uses it's own build system, it won't be
available. So, define it in the standard header too to cover such
a case.

Change-Id: Id708d1f20fe3b415968ad8475da449f54ad3c3fb
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-03-08 12:41:57 +01:00
Anas Nashif
c76c050bbd doc: board porting guide
Jira: ZEP-248

Change-Id: Iba83fceedc4fefe9d5319119f23cb392aca4c46a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-08 10:35:01 +00:00
Jesus Sanchez-Palencia
0877517ca4 ext qmsi: Update QMSI to 1.4 RC4
No major fixes since RC3 were made, and mostly the security fixes
for the Quark Bootloader were the main driver behind this new QMSI
Release Candidate.

There are no changes to shim drivers at this moment.

JIRA: ZEP-1572

Change-Id: I68d2b0ee90863d3def909de556314bd86712a059
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2017-03-08 07:02:57 +00:00
David B. Kinder
75d17fa3db doc: move IP porting guide to porting section
Move ip porting guide from the subsystem/networking section to the porting
section of the documentation.  Tweak the layout of the doc for improved
readable too.

Jira: ZEP-825

Change-Id: I688151f1da8862a783a82bcd4dde654c5178c30f
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-03-07 23:27:02 +00:00
Jithu Joseph
6754f8eaaf boards: arduino_101: enable GPIO by default
Though the SPI_CS_GPIO Kconfig entry (in drivers/spi/Kconfig) has
"select GPIO" specified, we are observing that merely adding
the symbol(SPI_CS_GPIO) in the
defconfig  (boards/x86/arduino_101/Kconfig.defconfig)
is triggering unmet direct dependency warnings
(though the build goes through).

Since the defconfig entry(SPI_CS_GPIO) is not selecting
the aforementioned 'select' rule, we add it  manually here.

Jira: ZEP-1668

Change-Id: Ida6a0c851462d747e6559bd0c78fa52e1d0f24b5
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-03-07 23:25:44 +00:00
Kuo-Lang Tseng
5873fee475 samples: pwm: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is safer because device name can change and
the app does not need to change.

Jira: ZEP-1764

Change-Id: I3c7716fd72e77c99fd29e4e90634c33f47f32e4c
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-03-07 23:03:44 +00:00
Qiu Peiyang
8d4f1bcb78 tests/gpio: enable gpio cases to run on more platforms
Add pin definitions to enable GPIO cases to run on
Quark D2000.
Add pin definitions to enable GPIO cases to run on
arduino_101_sss.

Change-Id: I97eadb8316b1f80b899b167a01effab815626dae
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-03-07 23:03:01 +00:00
Qiu Peiyang
935663f05e tests: fix disabling of GPIO interrupt issue
According to ZEP-1717, removing the callback from
the gpio is not enough to disable interruptions.
You also need to call gpio_pin_configure() on
the input pin without the GPIO_INT flag to totally
disable the interrupt for the pin.

This commit will stop level interrupt from being
fired constantly.

Change-Id: I019d7cea0bc0d5e5ff4b74165472ed11de1733bb
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-03-07 23:01:52 +00:00
Qiu Peiyang
2d033483de tests: add zephyr pinmux driver api test case
This commit verifies the following pinmux driver apis:
	pinmux_pin_set()
	pinmux_pin_get()

Change-Id: Iedf1b4e918b518b2205e9059b3b08f41cd243d37
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-03-07 23:01:28 +00:00
Qiu Peiyang
1124da16de tests: add zephyr SPI driver api test case
This commit verifies the below SPI driver apis:
	spi_configure()
	spi_slave_select()
	spi_write()
	spi_transceive()

Verify SPI work in SPI_MODE_CPOL, SPI_MODE_CPHA,
and SPI_MODE_CPOL | SPI_MODE_CPHA.

Jira: ZEP-1626

Change-Id: I1985ac6ff8269ac908817644a844720f2d7a125c
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-07 23:00:54 +00:00
Anas Nashif
3b3659c0d2 sanitycheck: run legacy tests only on daily basis
Change-Id: I3d928264cc47e8e71f05b691133814bcf8a0fd3f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-07 22:54:54 +00:00
Jithu Joseph
fbde97d44a tests: drivers: uart: fix variable type mismatches
These were flagged by icx build.

Jira: ZEP-1864

Change-Id: I5b8fce64d9e20d768fabf02e2a799e9390e3679a
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-03-07 12:00:33 -08:00
Vinayak Chettimada
8747090426 Bluetooth: Controller: Kconfig option to set public address
Added Kconfig option to be able set public address. Seems
conformance testers look for valid public address.

Change-Id: I2c4f702117f99a42c9eef0133b46556a1c6d1496
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-07 14:51:54 +01:00
Vinicius Costa Gomes
370571b563 build: Fix qemugdb target
Even deprecated, this target should still work, the issue was
introduced by commit 2bc9d69981.

The problem is that for both of those targets the board's specific
Makefiles should be include'd, it was done only for the non-deprecated
target ('debugserver').

As a note: that is the recommended way of doing a logical OR operation
in Makefiles.

Change-Id: I3ae8f5201c47e65b33a62cea45e25dc2226de489
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-03-07 12:46:14 +00:00
Andrew Boie
10c41eea00 samples/logger-hook: fix usage of ring buffer
- Ring buffers provide no concurrency control. Since the ring buffer
is being installed as the system log hook, multiple contexts may try
to write to it simultaneously. Lock interrupts to prevent corruption
of the ring buffer.

- NULL pointers were being passed into sys_ring_buf_get() for the
'type' and 'value' parameters, causing undesirable behavior when they
are dereferenced.

- The 'size32' parameter of sys_ring_buf_put() was being passed the
number of bytes, not the number of 32-bit words.

- The 'size32' parameter of sys_ring_buf_get() was not bring correctly
initialized the size of the destination buffer in terms of 32-bit
words. This has been fixed. There is no longer a need to query the
API twice.

Issue: ZEP-1789
Change-Id: I96f9cc74f3711297727b4c5114b6c93510f4a8c1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-03-07 12:40:23 +00:00
Luiz Augusto von Dentz
a9655eee4b Bluetooth: L2CAP: Add TX queueing for LE CoC
This allows to queue buffer to sent later in case it runs out of
credits so it no longer blocks the caller thread.

Jira: ZEP-1776

Change-Id: Ifa9b412f98889b50c0b889655d910520d11a4718
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-03-07 13:24:58 +02:00
Luiz Augusto von Dentz
03ff07ea7f Bluetooth: L2CAP: Move functions in preparation for queuing
This moves necessary functions that will be needed for queuing packets
while waiting for more credits.

Jira: ZEP-1776

Change-Id: I030c696d432ec5be1b8e6b649e953da145929777
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-03-07 12:21:29 +01:00
Vinayak Chettimada
966fbbcd04 Bluetooth: Controller: Run all enqueued mayfly before disable
Controller asserted in preparation of a role event due to
the previous (same or another) role event preparation being
not complete.

Mayfly callee was disabled in the previous event due to the
preparation time being short and previous start running
(higher natural priority) before all previous preparation
mayfly completed. The previous start disabled mayfly to
avoid Radio ISR latencies.

The current role event that asserted, preempted the
previous role (observer role with continuous scanning
window) which runs until preemption to maximise the Radio
h/w use (observer scanning until next interval). The
previous preparation mayfly is still disabled when the
current role preparation tries to use same mayfly instance
which should be free for a new enqueue.

This commit updates mayfly implementation so that mayfly
callee is disabled only after all enqueued mayfly instances
are run to completion.

Jira: ZEP-1839

Change-id: I3e0d31422db8e47b819189110b11ebd07dd09a7c
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-07 12:21:29 +01:00