Commit graph

19237 commits

Author SHA1 Message Date
Ido Yariv
6b6ef8bbb7 QEMU: Add optional PCI support
To debug PCI drivers on QEMU, it may be desired to enable CONFIG_PCI for
QEMU targets. Since the PCI driver requires a SOC pin2irq translation
function, add such function to IA32's SOC header file.

Change-Id: Icf6f88aa14ae29d70fe12dc80a708e6a2e992ba8
Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
2016-02-05 20:25:29 -05:00
Daniel Leung
631c3b1242 samples: adds a sample for using aio_dw_comparator driver
Change-Id: Idcfe266db237a0f2aaa6376562cf92bb49e626cc
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:28 -05:00
Daniel Leung
1b6c88ffe2 aio/aio_dw_comparator: adds Kconfig for IRQ priority
Adds a Kconfig for setting IRQ priority, and set the default to 3.

This fixes an issue where the interrupt vector as placed in wrong
slot in the IDT table since the priority was zero, and thus
no interrupts from the comparator was received by ISR.

Change-Id: Ief2100c1d79e42f8cedc4e0ca21ed5f6970d62e2
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:28 -05:00
Daniel Leung
985c0b1de4 aio/aio_dw_comparator: use Kconfig to define device name
This makes the aio_dw_comparator driver to follow others by using Kconfig
to define device name. This makes using the device in apps a bit easier.

Change-Id: I4fbcb0c009c863a2216a15a78a8aa6324d95690b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:28 -05:00
Daniel Leung
9709c1008a samples: adds a sample for interfacing with APA102C LED
Change-Id: I653a47c942a36ce4002f0acad29c4978aa47080a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:28 -05:00
Dmitriy Korovkin
9183e1f4de device: Make device_sync_call_complete aware of the caller context
device_sync_call_complete can be called from ISR, fiber or task, thus
needs to be aware not only of the waiter context, but also on the actual
caller one.

Change-Id: I76652a2c44d854db9c34e7192355d455d43f61e3
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:25:28 -05:00
Andrew Boie
f0a1d22f28 x86: leave the GDT in ROM by default
We don't normally need a runtime-mutable GDT; make it optional to
activate a second copy in RAM. Regardless of whether it is in RAM
or ROM, it can be accessed by the '_gdt' symbol.

Change-Id: I5ce955f4b8875eb60040917ceaacc07d7e5941ac
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:28 -05:00
Daniel Leung
cb76f11259 arch/arc: fixes native C version of atomic_nand
Change-Id: I2f493e2c7cb841ef1273e628701d3b087d402e3f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:28 -05:00
Peter Mitsis
61e6f4a299 sys_clock: Lock interrupts when processing announced ticks
Interrupts must be locked when processing announced ticks in
_nano_sys_clock_tick_announce().  This prevents higher priority
interrupts from interrupting the tick announcement and possibly
corrupting the timeout and/or timer queues.

Change-Id: I4e87fc5b3ad36161e0accb50b2691f975f5877e5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:28 -05:00
Jukka Rissanen
1b7b470cb0 net: contiki: Fix the debug printing support for ICMPv6 code
Change-Id: I01ea438e946ec597ac389bd26f0f26c307efa65e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:28 -05:00
Jukka Rissanen
d9f50cdb9d net: contiki: Make sure ICMPv6 support is activated
We need ICMPv6 support if IPv6 is enabled.

Change-Id: I5e6ffe83d8299916bb268d136264f3e5cf6f91e6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:28 -05:00
Jukka Rissanen
2822ed6537 net: contiki: Fix the NA ICMPv6 sending
The ICMPv6 NA (neighbor advertisement) packet length was not set
correctly so no NA message was sent.

Change-Id: I7ddf41545f4b07da669d29f2529f5b04d3bc8b75
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:28 -05:00
Jukka Rissanen
1e9fd8da9b net: Enable IPv6 neighbor discovery by default
The IPv6 neighbor discovery is needed when dealing with real
brearers like 802.15.4, so enabling ND by default.
In Qemu and if SLIP is used, then the ND needs to be disabled
as it does not work properly with tun devices.

Change-Id: I8baf11e71fb546b698a0a3d18fcacb142744db60
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg
a9404225e5 Bluetooth: Use NULL for "any" connection with bt_conn_lookup_state_le()
An all zeroes address is in principle not valid, but prototype devices
have been seen using it. To avoid false-positives with the
bt_conn_lookup_state_le() API use a NULL pointer rather than
BT_ADDR_LE_ANY to indicate that any connection in the specified state
is of interest.

Change-Id: I42a1946e47173b17be295b1b7e97a654dbdcdc6a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg
27fe6fcb46 Bluetooth: L2CAP: Further simplify l2cap_chan_create_seg()
Change-Id: I57d45fcb0647459d9b5b465d175064fa3a194601
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg
aa1d49041b Bluetooth: L2CAP: Take advantage of net_buf_push_le16 helper
Change-Id: Iff5e2b8f7d16f829b93832f513113c6c6c292d37
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg
8d98247c8f net: buf: Add net_buf_push_le16 helper function
Change-Id: Icce051392d1523df8ebfeccf76477a6264d3d216
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Szymon Janc
66413dad20 Bluetooth: L2CAP: Fix not sending all bytes of SDU
There are always 2 additional bytes for SDU length in first packet
and those needs to be taken into account.

Change-Id: I3c202cd969524036b42d919bc001e75b8c2faaa0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:28 -05:00
Szymon Janc
47f0279502 Bluetooth: samples/shell: Fix printk modifier
Use %d for printing signed integer.

Change-Id: I6fbf387969e97561430ea0d2d422842c599f1457
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:28 -05:00
Szymon Janc
719e8e4710 Bluetooth: Fix not updating LE keys on Key Refresh Event
If link is already encrypted controller issues "Encryption Key
Refresh Complete" for "LE Start Encryption".

Failing to update keys resulted in invalid security level being set.

Change-Id: I8d8dd1682937bd35a35111366ec6ebdaa619db7c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg
56ba2ffb6b Bluetooth: Remove unused bt_uuid_copy() API
There are no more users of this API, and the only user it had in the
past was quite a special corner case. Just remove it for the time
being.

Change-Id: I696139b493f9ca75530665de25a4a4e03fc0ac5b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg
d5e23e86d2 Bluetooth: UUID: Introduce new API
Introduce new UUID API with bt_uuid, bt_uuid_16 and bt_uuid_32
structs. The specific size structs are derived from the common bt_uuid
struct to make it possible to use CONTAINER_OF().

Change-Id: I9cb03c73406acb7768d410fdf29eae75d252163c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Szymon Janc
4e29c31512 Bluetooth: L2CAP: Fix not calling disconnect callback
Destination CID identifies the channel endpoint on the device
sending the response. So in disconnection response DCID matches
CID used for TX.

Change-Id: Id42d61536bcc208e868ac889c738e7c40bcf5a9a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:28 -05:00
Andrei Emeltchenko
81b4ffbf93 Bluetooth: bttester: Trivial style correction
Change-Id: I39e2c414ec1e972112bda0ba3ca1d1626c32bb18
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:28 -05:00
Luiz Augusto von Dentz
60ea587c59 Bluetooth: L2CAP: Fix bt_l2cap_chan_send
The l2cap_chan_le_send_sdu code was not taking into account that
bt_l2cap_send adds its on headers which means buf->len != ret won't
stop once the last remaining segment is sent since it reuses the
original buffer len is not consumed.

Change-Id: I774da976fb4f71127ae30adf1e02d52946fb9592
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:28 -05:00
Luiz Augusto von Dentz
23ac865f33 Bluetooth: L2CAP: Fix bt_l2cap_chan_send documentation
bt_l2cap_chan_send does actually return the number of bytes sent.

Change-Id: I9dd79da992577f2e1e8d30d42eeb0c398e48ff33
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:28 -05:00
Luiz Augusto von Dentz
5506ec6f09 Bluetooth: Shell: Fix l2cap-send
bt_l2cap_chan_send does actually return the number of bytes sent.

Change-Id: I862a8519c752c6b26250a21be02a927a9326617c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:28 -05:00
Andrei Emeltchenko
ca57c08e0f Bluetooth: nble: Implement get_version_rsp()
Implementing on_ble_get_version_rsp() allows to check firmware version
of Nordic BLE chip.
Current output is (stripped):
...
bt: on_ble_get_version_rsp: VERSION: 0.0.0 ATP1BLE000-1604C5546
...

Change-Id: I98d3cd659cbed86b31eb90aac0e3ae876daf616a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:28 -05:00
Luiz Augusto von Dentz
bcea32a2ca Bluetooth: shell: Don't call bt_enable blocking
Now that nble driver is supported bt_enable cannot be called blocking
since it is not supported, futhermore the call to bt_gatt_register
should be done after bt_enable is complete.

Change-Id: I404f8cd8b8339dba0fd26d24edeb718eba4bf225
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
26e152f734 Bluetooth: doc: Add notes for building with NBLE enabled
Change-Id: I77f4c25bacd4f6233152d44d36f3057f4ac108e7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Szymon Janc
dfb9441221 Bluetooth: L2CAP: Fix missing unref if link was disconnected
Buffer returned by l2cap_chan_create_seg should be unreffed if
disconnected.

Change-Id: Ib794ecc98618eddc9d92b2dc2edf829c50123418
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
4124327525 Bluetooth: nble: Correct platform name for Arduino 101
This enables this test case for arduino_101 platform.

Change-Id: I2a94fb90f4c57022ddf1ec11ab06bb5e59de9b6e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
af6d20461b Bluetooth: tests: Remove extra board definition for NBLE
Board already defined in platform_whitelist

Change-Id: I2fed4b3c0663fd15d43ee697837a89439f7bd07a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Anas Nashif
4414d2f308 Do not set BT config options if NBLE is not enabled
!BLUETOOTH is almost always when not using BLE, so depend
on NBLE being configured as well to set various options.

Change-Id: Idc61cee277fe0f09086a9f2ed6eb419aee5fd69c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:27 -05:00
Johan Hedberg
44541091dc Bluetooth: GATT: Remove unnecessary usage of full UUID structs
To access the 16-bit value of GATT UUIDs it's quite overkill to first
create anonymous UUID structs and then access the value member from
them. We can simplify this a lot with the help of the recently added
UUID value definitions.

Change-Id: Ib58012c20d07b3e60e5911cea6feb73301d1323c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:27 -05:00
Johan Hedberg
f448b6810d Bluetooth: UUID: Add value definitions
In some cases we need the raw 16-bit UUID value instead of a full UUID
object. Add definitions of these values so that the code doesn't need
to do complicated tricks to get hold of them.

Change-Id: I98f276402f20fe03fea2777743f15ca7fcae42c6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:27 -05:00
Szymon Janc
92e84bbfb8 Bluetooth: samples/shell: Fix use of NULL net buffer
Don't use NULL pointer if aquiring net buffer failed.

Change-Id: I11a22b832d1da9559b90abe0cb83eed56d14722f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:27 -05:00
Mariusz Skamra
71472f8aca Bluetooth: tester: Convert advertising data
This adds conversion of advertising data (adv_data) to be used by
bt_le_adv_start function.

Change-Id: I403ff7ebed89dbf763d258b5dcdabfbb2cb68260
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
1636eca4cb Bluetooth: shell: Add NBLE shell test to sanitycheck
Test can be verified with

$ sanitycheck -s bluetooth/shell/test_nble -v
arduino_101  bluetooth/shell/test_nble  PASSED

Change-Id: Icfc5892524041d169973bd6eb7d23b6ecffb98fc
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
d5d9e081c6 Bluetooth: shell: Add Nordic BLE configuration
Allow to build shell for NBLE.

Change-Id: Icbd019ee1947f2dcf3bc358685024f22c6a5de34
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
355146d2aa Bluetooth: shell: Fix usage of BREDR functions
Fix compiler errors when CONFIG_BLUETOOTH_BREDR is not enabled.

Change-Id: I003985a9769120b3314eaf1b9563a3bf9712e32a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
e4777eca2c Bluetooth: shell: Make buf_data local
Move buf_data to the place it is used reducing errors when dynamic
channels are disabled.

Change-Id: I82f640ffa8046e1c9b5805658e69cb722856d445
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
06d9e61dd6 Bluetooth: shell: Fix dynamic channel usage
Fix wrong dynamic channel usage in shell

Change-Id: Ieb6505b4c5ce1d380af4ac0b5ef788b16a2eeb4d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Luiz Augusto von Dentz
59a4e2eaea Bluetooth: tester: Add support for testing with nble driver
Change-Id: I4c996d30da30d8f3b88d7ba9efe974872f902e0a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:27 -05:00
Luiz Augusto von Dentz
dab10c414b drivers/nble: Add UUID support
This reuses the existing code since that is not driver specific, with
this samples such as tester can be build using nble driver.

Change-Id: I6d9f3edf8deb2e84fce233ef02d1cd0ad6f52526
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:27 -05:00
Luiz Augusto von Dentz
7834061d12 Bluetooth: ATT: Check mask instead of specific permission
This enables simpler permissions as it is not longer needed to include
BT_GATT_PERM_READ or BT_GATT_PERM_WRITE.

Change-Id: I0c749b75bedb125bda8ea451474c82eec13d3c38
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
eea10dd425 Bluetooth: test: Use correct target for Arduino
Current quark_se target is not specified in
scripts/sanity_chk/arches/x86.ini list and apparently this is the
reason tests were not executed, change it to arduino_101.

Change-Id: Ifedcf08cc9b25839d389bd7eb92ed42012e9075a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
6c988ba401 Bluetooth: beacon: Correct arduino target
Putting right target allows to build for arduino_101.

Change-Id: Ib11244c7f024c72f0ab0b15549be57c576bdef3c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
a166d5fd6d Bluetooth: nble: Include right platform
Currently it is not possible to build for Arduino since wrong platform
was specified.

Change-Id: I85ff6f5adb003db9a0905d6afa04bb5dfbd55d53
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Luiz Augusto von Dentz
16f398ddf7 Bluetooth: UUID: Fix conversion to 128 bit format
The current format used is a swap of RFC 4122 thus the 16 bit values do
come at the end not at the beggining and data need to be swapped.

Change-Id: I38a27cdf82a28d28e47675f719772278d85deaaa
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:27 -05:00