The code fragment to bind the instances of the SPI driveri is not
platform specific but is driver specific.
All the information required to bind a driver instance comes from
CONFIG_ variables. Having the binding code with the driver code
avoids duplicating the code fragments in each platform where the
driver may be used.
Change-Id: Iff40227e3e25d431ae870d585445971f35d934dd
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
The code fragment to bind the instances of the GPIO driver were being
replicated in every platform_config.c This code is not platform
specific but is driver specific.
All the information required to bind a driver instance comes from
CONFIG_ variables. Having the binding code with the driver code
avoids duplicating the code fragments in each platform where the
driver may be used.
Change-Id: Ie07a3d12d25201e82ce7074455e6c036f463851b
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Features displayed with "[EXPERIMENTAL]" should depend on
CONFIG_EXPERIMENTAL.
Change-Id: I0a86dff442014caa2fa4629138dbe29e69d5b853
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
This buffer can be examined at runtime with a debugger to see what
is going on. Helpful if there are no other working console drivers
on the system.
Change-Id: I759467a57d16204b4b316c4f6fa8b7d5e1d1d236
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This will be useful when an implementation of a generic API requires an
int as user data when such has been defined to be a pointer.
int do_something(struct device *dev, void *user_data);
When the implementation would:
int impl_do_something(struct device *dev, void *user_data)
{
int identifier = POINTER_TO_INT(user_data);
...
Change-Id: Ic892927a03ac49e95527ef8e0e817d00256aa3bb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Match loapic.h and allow 'ioapic like' drivers to export same ioapic
interface.
Change-Id: Ia2e5380cf9c3fc72e27beb198013e7416daa6aca
Signed-off-by: heeleyth <thomas.heeley@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The c files actually check for the Kconfig variables, so there is no
need to do the checking in the Makefile again adding double logic.
Change-Id: I8521047bd575c8f9d64f7d8e5abfb5eee8a40cb3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Do not enable the feature by default when EXPERIMENTAL features
are enabled.
Change-Id: I0538f9f94bb47a4bc870c8974e80faf273070f91
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When configured as GPIO_ACCESS_BY_PIN, the callback should
be called only if the pin is enabled and received an interrupt.
Change-Id: I7addeb57c8d46dddc027e9b82a92654cd210ade1
Signed-off-by: Ricardo de Almeida Gonzaga <ricardo.gonzaga@intel.com>
if printk is disabled, the variables will be unused and we will
get compiler warning.
Change-Id: I5dad791ae89d7a8c98f9e4660da472ef0caacc92
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This enables passing the value to be used when writing to CCC so it can
be configure for indications in adition to notifications.
Change-Id: Ied89faed422e5c5ec60618d512dbd3f250f50b46
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This enables bt_gatt_subscribe to subscribe using indication value in
addition to notification.
Change-Id: I25f3b057e36b023a79fb66b11b70716ecc299ba9
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The correct code is 0x1e not 0x1f.
Change-Id: Icee68ebd01d76a4b3ed31a54e18b1115172f5b71
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Some controllers are broken in that they may send a completed packets
event after a disconnection has already occurred and the handle is
invalid:
> HCI Event: Disconnect Complete (0x05) plen 4
Status: Success (0x00)
Handle: 64
Reason: Remote User Terminated Connection (0x13)
< HCI Command: LE Set Advert.. (0x08|0x000a) plen 1
Advertising: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
Status: Success (0x00)
> HCI Event: Number of Completed Pa.. (0x13) plen 5
Num handles: 1
Handle: 64
Count: 1
Since the disconnection code already takes care of updating the
le_pkts_sem semaphore appropriately there is no need to do anything
for this kind of events (except log a warning of a misbehaving
controller).
Change-Id: I67b35aa50f7297d6bcdeeeab62f1f1d224b1a372
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is in preparation for being able to compile out SMP support.
Change-Id: Idb3597dd16e457d19d592a9b7dce954b950b174e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Separate connection master role related parts in single block making
it simpler to split. This is a preparation for being able to compile
in only central or peripheral role support.
Change-Id: I27dc9b32048bf4e682149d5f1d5edbd994155e2b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
The HCI driver send() callback may fail and in such a case require
different handling on the core stack side. This patch introduces the
missing error handling to the places calling drv->send().
Change-Id: Ia0e4f05aedd88c268cf0da98b11924eb3c5c4c0b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The core specification says the following about the treatment of
unacknowledged packets when a disconnection occurs (page 773 in core
spec 4.2):
"When the Host receives a Disconnection Complete, Disconnection Physical
Link Complete or Disconnection Logical Link Complete event, the Host shall
assume that all unacknowledged HCI Data Packets that have been sent to the
Controller for the returned Handle have been flushed, and that the
corresponding data buffers have been freed. A Primary Controller does not
have to notify the Host about this in a Number Of Completed Packets event"
This patch adds tracking of unacknowledged packets on a per-connection
basis and makes sure the semaphore that counts controller buffers is
given back the appropriate amount when a disconnection occurs.
Change-Id: I2ff4d12ffa50d4dda5b3e8c75fc75b4c0927e609
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The send() callback of HCI drivers should be returning 0 on success
and a negative value on error. The uart_fifo_fill() function returns
the number of transmitted bytes so it can not be directly mapped to
the send() return value.
Change-Id: I59be478c1985f44a46f2a9613f61471423b0e63a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Separate connection related parts in single block making it
simpler to split. This is a preparation for being able to compile
out connection support.
Change-Id: I992e604cae848ed2dfe821a6971248e53ae23498
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This patch factors setting up controller to host data flow control
to separate function. This is a preparation for being able to compile
out connection support.
Change-Id: Ibcce0b740534331a6365c2370b7b637877d71560
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
All required includes should be placed in source file that includes
internal header.
Change-Id: I161e7ebe2e62377ea4cf03f759d48f5900103076
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Writes to GATT attribute that has no write permission set, should
return write not permitted (BT_ATT_ERR_WRITE_NOT_PERMITTED)
in check permission routine.
Change-Id: I95f0988e171294cd98b79d3e7b518383ac47567d
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Move parts of the API that are not usable for applications to
an internal header.
Change-Id: Idbcd3db8acda74375ea9deec2bf3d7eddc8a4ddb
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If no attribute with given handle is found in database then invalid
handle error should be set and returned. If attribute is found then
pre-set invalid handle error will be cleared.
Change-Id: I4119877bb72693e18003399f9b6764666f801fe4
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
This makes menu cleaner and easier to follow what options
are Bluetooth specific. It is now similar to IP configuration.
Change-Id: Ic2f6002ab30093bed62e71fe268a576d69a9cd0d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Tinydtls had its own .gitignore file that masked away two
include files that are needed in compilation. Removed
the files from ignore file and added those two files.
Change-Id: Ibcfcf4e18ca8f56eef97d41464c4233148e9db9e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the remote response with encryption/authentication error attempt to
elevate the security and retry sending the request:
bt: bt_att_recv (0x00112e0c): Received ATT code 0x01 len 5
bt: att_error_rsp (0x00112e0c): request 0x0a handle 0x0018 error 0x0f
bt: security_changed (0x00112e0c): conn 0x0010f5ac level 1
bt: security_changed (0x00112e0c): Retrying
bt: bt_att_recv (0x00112e0c): Received ATT code 0x0b len 1
bt: att_handle_read_rsp (0x00112e0c):
bt: att_read_rsp (0x00112e0c): err 0x00
Change-Id: I9d74fb50385c39b2092357f4fd6912a3eb041442
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Clone request buffer so it can later be used to validate the response.
Change-Id: I306f7b01a9a72a6c4b8e97c30789247b28428365
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This documents describes protocol used by external tester to drive
IUT. Currently initial version includes only Core and GAP services.
Change-Id: I2fcb366076313880116be2ead8916bb56a4b5910
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Use correct config option to either enable or disable
neighbor discovery.
Change-Id: If67219cfa71893d2805b37e5ab3bbd11af789cb5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This adds bt_buf_clone which can be used to duplicate a buffer, including
its contents.
Change-Id: I473841e1fce00fddbfac1fb2c55d40741658484f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This big patch refactors tester application and put it in par with
updated tester protocol.
Change-Id: Ib016fdd0aac58a32bcdc67774843cf65d619947d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If bt_enable() is called from a preemptible context we need to make
sure the RX prio fiber is initialized by the time the HCI init runs
from the hci_rx_fiber function.
Change-Id: I91bb0c69d011944ee2a035b2a707618632a6b189
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There is no need for local copy of addres. Use pointer instead.
Change-Id: I4681af527813093547d2641ab2390cfa64383d6b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Connection address based on keys is already selected before call to
check_pending_conn. There is no need to select it again.
Change-Id: I2f1a329c19f5c08734c50dbf8d32bf5c28192a35
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This is a mandatory characteristic for GAP servie. It must be included
in GATT db.
Change-Id: I27c0c6d56f5303c3c5d1606d7656c51823f74989
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
Pass service handles to the callback during service discovery.
Change-Id: I616de5188faf76c84cc02ceb29a6f5aab631b89c
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Do not use local _isdigit function, use public isdigit
instead.
Change-Id: Ifc2721fc2def429de4934c9855f08dae30326694
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This option adds optional libc functions that are not directly
used by the kernel but can be used for testing purposes.
This option is experimental.
Change-Id: Ia4dba718359c4f381047a5b52ebddb26d87ea75a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add function for comparing two strings ignoring case.
Change-Id: I2fc78c0a0d0f53e23566ffacd8dca3b23e386c26
Signed-off-by: Anas Nashif <anas.nashif@intel.com>