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>
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>
__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>
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>
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>
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>
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>
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>
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>
These were flagged by icx build.
Jira: ZEP-1864
Change-Id: I5b8fce64d9e20d768fabf02e2a799e9390e3679a
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
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>
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>
- 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>
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>
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>
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>
Add a sample application demonstrating doing continuous scanning and
sending out advertising packets periodically.
Change-Id: I0ce88afd73bed4928ba65472051c0f83ff27a632
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The 100ms limit is only valid for controllers before version 5.0. For
a 5.0 controller the minimum is 20ms (0x00a0) which is already checked
for later in the valid_adv_param() function.
Change-Id: I0566a38ff855800d2e46e1d2c0a5c7bc9bc610cd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Since there are no mandatory features in 5.0 when compared to a 4.2
compliant controller, report 5.0 as the current specification
implemented by the controller, to allow for features such as short
advertising intervals (< 100ms) which are already supported.
Change-Id: I1b138a86290a0422760a5e265cdd7b72d68f0048
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add support for detecting version 5.0, i.e. 0x09.
Change-Id: Ia2da513b65c420142fe97a4fa173bfa8045e9d75
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Filters the service records by going through all the records and
removes the one which does not have the uuid. So finally, only
the records which has all the uuids in the service search pattern
will be present in matching recs.
Change-Id: I1daa7c1b645efae2af66962999cc4c541891eff7
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
The introduction of device tree broke bluetooth sample builds for the
hexiwear_k64 and frdm_k64f boards. Add these boards to the peripheral_hr
test so this doesn't happen again.
Jira: ZEP-1745
Change-Id: I3e61a83db09cbb5834bd510bff851611e43844a8
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
bt_gatt_get_mtu can be useful when GATT is used to transport another
protocol on top.
Change-Id: I328ef49138ccc4ce642b0019d08060f6022d5aa7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Handles the service search request from peer, parses the service
search pattern (which is a data elem seq of uuids to be searched)
and populate the uuids.
This also populates the registered records which will be filtered
based on the uuids in the pattern (which will be done in the subsequent
patch).
Change-Id: I9a232a7cfdd159325214ed13e98cc20be39a2e3b
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
This is mainly done to avoid VLAs for looking up the service to handle
service search requests so that we can make sure that RX stack size
is sufficient for the defined no of services.
Change-Id: Ia99072615d9094a35bd7605ed2901e8018c0ecb2
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
Instead of returning -EINVAL at runtime assert in case of invalid
parameters.
Change-Id: I40505f06a4c12445bfb1f1846ace1b592b6bc342
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Separate out data element structure header into type and size fields
Change-Id: I869ee1ea82db1f6d669bb905055135b7d63f3fa2
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
L2CAP TX and RX MTUs will be exchanged during configuration req/rsp.
It should not be modified after connection.
Change-Id: I1e291c9e093561f349bcdcbb75cd7ff22b4163a5
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
A new Kconfig debug option now controls the usage of pin toggling to
debug the BLE controller.
Change-Id: I24c5c13ca71e3395e10f14e27ad4bca9f2e94687
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Use macros to identify the different debug pins used to monitor the
runtime behavior of the controller, for easier identification of the
lines.
Change-Id: Ia76d6298985b1d367b7ad193d8261f5403446371
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Added structure to account for the preset. The user can use the
SBC codec.
Change-Id: Ia2466b6fc166cae919f82a8042f4dd047ed28772
Signed-off-by: Piyush Itankar <piyush.t.itankar@intel.com>
Added an API to allow addition of stream end points by the application.
Change-Id: I91b95fc5dc3b9b2950e8d55b5846e460e55f2453
Signed-off-by: Piyush Itankar <piyush.t.itankar@intel.com>
It was observed that due to possible CRC errors, one
connection interval was not sufficient by the peer to
respond to LE Ping PDU which caused the Controller to
generate the Authenticated Payload Timeout event to host.
This fix advanced the dispatch of LE Ping PDU by 6
connection intervals that the peer would listen to before
the 30s timeout.
Change-id: I6c292c623047a05b4e771e70093d87228db62cce
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
The new hard real-time (direct) interrupt support is used
only for Radio IRQ. Only Radio ISR has hard real-time
requirement of completing its execution inside the tIFS of
150us.
This commit reverts back RTC0 and SWI4 ISR to using the
normal IRQ_CONNECT.
Observed on nRF51, Radio ISR (open text, notifications):
Latencies: min. of 5us and max. of 10us.
CPU utilized: min. of 44us and max. of 77us.
Observed on nRF51, Radio ISR (LESC, fast encrypted,
notifications):
Latencies: min. of 5us and max. of 10us.
CPU utilized: min. of 39us and max. of 112us.
Jira: ZEP-1038
Change-id: Id3d09df7bdbdfea090f21f6f58aaded8c5f1e10d
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
The new hard real-time (direct) interrupt support in the kernel allows
ISRs to be run directly with no significant latency overhead.
Use this new mechanism to improve the latency of the 3 critical
interrupts in the controller: radio, RTC0 and SWI4.
Jira: ZEP-1038
Change-Id: Ief9dacbea4c4c2e8a1c77893a0d6175a91819ffb
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This fix not removing subscription if it was first element on the list.
In that case prev was NULL resulting in passing garbage node to
sys_slist_remove.
Change-Id: I9452af08409692f9a331afd514fbac8cc727d289
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Parameters and data must be permament for time of the operation.
Change-Id: Idd4eee948e62c2c80648116a339558042059f801
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Instead of passing exact value allow to use 'ind' for enabling
indications instead of notifications.
Change-Id: I24306a321ed90b4bcb6300846218ff7214b39bc4
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Don't echo data from received callback as this can cause
deadlock. Just dump incoming data instead.
Change-Id: Iedbbafd0406ad46ba2c9d26fd8a70fff59de8143
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>