Commit graph

19237 commits

Author SHA1 Message Date
Luiz Augusto von Dentz
9e74b5171f Bluetooth: beacon: Add support for testing with nble driver
In addition to having a different CONF_FILE bt_enable needs to be given
a callback since nble driver cannot block while initializing.

Change-Id: I8bd2c79d0620e93dbecfef25c49c5529ff1ee954
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
f4c5c9808a Bluetooth: nble: Fix missing format specifier
Change-Id: I6adbd6e19462b15644d32714ae7d454fac0ece32
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
5da3fbdaf4 Bluetooth: att: Use correct format specification for size
Change-Id: Ida06f2d34bfd41256a98c79200717329497667ac
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko
bab5744358 Bluetooth: nble: Allow to build UART driver for nanokernel
Change-Id: I9901942521c376a22a6990835bce8ed7752a4b1a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Arkadiusz Lichwa
2dc833880e Bluetooth: BR/EDR: Rename encr_mode to encr_enabled
Adjusts encryption state name in connection complete event.

Change-Id: Ib7e6b2c5738ca9f5832e0e277d8f5718050f4bef
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:25:27 -05:00
Szymon Janc
e6f0356df7 Bluetooth: SMP: Fix legacy passkey entry for central role
In legacy passkey entry method confirm value is sent first.

Change-Id: Ic379650dab64715be6d281fa8d3389f5ff34a978
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:27 -05:00
Szymon Janc
04f6d80ff3 Bluetooth: SMP: Fix not initializing context correctly
Use uint8_t for pointer arithmetic when clearing SMP context so that
correct memory is cleared.

Change-Id: I8b88bc4c2eb181397bce5fb80a6ab250086cb17d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
44e311ed19 Bluetooth: nble: Limit number tries when reading from UART
There are situations when nble_read() might stuck reading from UART when
there is no data. Limit number of tries to 10.

Change-Id: I23380b622439ce9fa72b05f4eb527f03c749fce8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
e8ffda4a73 Bluetooth: nble: Implement ble_log
Implement using printf(), to make correct stack use define check.

Change-Id: I81894ccb511f921a5fcff37d85790191251d683f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
f8f24d7661 Bluetooth: nble: Clean up code making it consistent
Change-Id: Icfd4f245a2674d865cb670d6c4549cd39d31ca6b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
9c3de9ebca Bluetooth: nble: Use weak functions printing debug info
Since the headers defining RPC with Nordic chip changes frequently
define weak functions printing BT_WARN("Not implemented") if
function is not defined.
Weak function symbol is marked with "W" as viewed by nm.

Change-Id: Ia39b64c6e89fdddc65683711fd192a235fe754d4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Johan Hedberg
53dd3ba2e0 drivers/nble: Implement bt_le_adv_start()
Change-Id: I169a2bc2f0e48473fbb50bdf8e651623e446c231
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:26 -05:00
Johan Hedberg
278d320f71 drivers/nble: Increase TX & RX buffer count to 2
This lowers the chance of running out of buffers when sending or
receiving a lot of data.

Change-Id: Ifedc5652f993fa54f7aded87aef545ffb49e7581
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:26 -05:00
Johan Hedberg
733f837aae drivers/nble: Fix passing correct length to poll_out()
The RPC code is not net_buf aware so it will not update the net_buf
length when encoding data into it. We have to therefore do it
ourselves.

Change-Id: I7d7d3c09007a2a9bce822625607dbf7470a7ea0b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:26 -05:00
Johan Hedberg
3e9bfe5119 Bluetooth: Add missing nanokernel.h dependency to log.h
Change-Id: Ifcdc2d44dc9223833dc628613fada3d2cf7daa8f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
8dbd03a5f5 Bluetooth: nble: Make GATT coding style consistent
Make code readable removing extra spaces.

Change-Id: I61e3486e1d301ff7d36fd2e34243ff6e9111e54d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
64b1989f56 Bluetooth: nble: Make GAP coding style consistent
Remove extra spaces and make code readable

Change-Id: I3e57a5440476eb0143d19ce9865d3a76c58b90d1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
ac59405268 Bluetooth: nble: Include all functions to build
Include all functions using previously defined stubs.

Change-Id: If9ab3f02d2e3e1f27c09b0d666fcf531cf76898d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
d5100a0672 Bluetooth: nble: Enable GAP functions
Use debug stubs for now

Change-Id: I8e25ba8bb0fc4eec4d789c51e1599a17fa78cf5c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
228d0cb292 Bluetooth: nble: Enable GATT functions
Use debug stubs for now

Change-Id: Ia6f73ce3d289f3759a93eee42439fe7001770eab
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
acc88b8a71 Bluetooth: nble: Refactor header include logic
Change-Id: I4f4475360c317ba69584b34b33a1dd0f27edb022
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
702b151e47 Bluetooth: nble: Move receive logic to fiber
Move receiving logic to fiber rx_fiber(). rx_queue is registered with
uart driver and all data is sent there for processing. Clean up old
ipc_channel interface since there will be only one interface to uart
driver.

Change-Id: I292863b1f38e5adb8ca4e6ac63aed09c83de56bf
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
96aaaadca8 Bluetooth: nble: Adding NBLE ready callback
Refactored Johan Hedberg's code adding callback to be called when NBLE
is up.

Change-Id: I2a8a2238942c0adae2a5c47cfe94d8f2b1112810
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
500b59809f Bluetooth: nble: Drive BTWAKE high
Refactored Johan Hedberg's code adding writing to NBLE_BTWAKE_PIN one
to drive it high, needed to wake up NBLE chip.

Change-Id: I63b9583281db897f2326e4570716c25ce181128f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
cc190488ee Bluetooth: nble: Add basic RPC transmit code
Refactored Johan Hedberg's code adding initial transmit logic.

Change-Id: I44b0166c281d526fbd12b895b5777486c7392260
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
14613089e5 Bluetooth: nble: Add RPC deserialization functions
Port RPC deserialization to Zephyr upstream.

Change-Id: Icc9e055565185e907f51832443386f929a752586
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
79f47c65ba Bluetooth: nble: Add RPC Serialization IPC
Port RPC Serialization to Zephyr upstream

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Change-Id: I315d52dc6576254a6928520d1353856d41a25c69
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
124795afed Bluetooth: nble: Implement bt_enable
Resets Nordic BLE chip and opens communication channel to UART.

Change-Id: Ie516869a4d978fc1622361ebc42894430fdf9ea6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Anas Nashif
abb6e223cf NBLE: Nordic BLE is not a feature of quark se
Move BLE configuration to board and enable GPIO for NBLE.

Change-Id: I99c309656430936edf6766fc99fe83b011801bb4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:26 -05:00
Johan Hedberg
4218572c13 Bluetooth: samples/peripheral: Set right board for nble testcase
Change-Id: Ie0b1dceeb94a760dc9990a5c573616522169ea76
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
baeb34a950 Bluetooth: nble: Add UART driver for Nordic BLE chip
Adds basic support for communication with Nordic BLE (NBLE) chip
connected to UART.

Change-Id: I3651e291ec18805a63ecd3d240dce62273e3c498
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
d325faa670 arduino_101: Set UART0 default options and baud rate
Set options and baud rate to communicate with NBLE chip.

Change-Id: I338aad3b1dc03b809aade29eedac7093ea346a5e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Jukka Rissanen
f5a58453d4 net: contiki: Fix the RA ICMPv6 sending
The ICMPv6 RA payload was ignored and not sent. This was seen
as malformed packet by receiver. We must update the length of
the message by calling net_buf_add().

Change-Id: I3dc64cfce669de54283db290cfb009b2c6ea7225
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:26 -05:00
Jukka Rissanen
a38fc2fc11 net: contiki: Fix the NS ICMPv6 sending
The ICMPv6 NS payload was ignored and not sent. This was seen
as malformed packet by receiver. We must update the length of
the message by calling net_buf_add().

Change-Id: I5bf53695c811c27a75320fea7331d91782a9748a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:26 -05:00
Jukka Rissanen
209119cd63 net: contiki: Fix the RS ICMPv6 sending
The ICMPv6 RS payload was ignored and not sent. This was seen
as malformed packet by receiver. We must update the length of
the message by calling net_buf_add().

Change-Id: Iddedb7b6674f30c7943c0ba59c0afc7d244a1e0d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:26 -05:00
Arkadiusz Lichwa
ea3b162bac Bluetooth: BR/EDR: Add support for Link Key request
Delivers a valid Link Key to controller if found or responds negative
to Link Key request to controller.

Change-Id: I98061110a60b066421f35db44455925cbcd3076e
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:25:25 -05:00
Arkadiusz Lichwa
9b0d42930c Bluetooth: BR/EDR: Define HCI Link Key request
Enable HCI protocol for handling Link Key request event and
responses.

Change-Id: Ib3e24782257a87028b63198d210203b442883211
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:25:25 -05:00
Arkadiusz Lichwa
a68db1fc57 Bluetooth: BR/EDR: Enable encryption handlers
Get access to available link encryption related handlers.

Change-Id: Ifcf4cf3af11368ca68cd93d3023a020bb01a7b74
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:25:25 -05:00
Michael LeMay
fa484be4f4 net: ipv4: Add missing includes
This patch adds two missing includes necessary for building IPv4
support.

Change-Id: I381d0951df4ee615867743dbde551666b603fecc
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
2016-02-05 20:25:25 -05:00
Tomasz Bursztyka
838c98b023 cc2520: Use DEVICE_INIT() relevantly
Fix a build issue, as DEVICE_INIT() is the only macro used now and
others have been removed.

Change-Id: I69f7df168f5c4284104068b79ba9097d9a1904c1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:25 -05:00
Andrew Boie
897ffaeb2c irq: rename irq_connect() to IRQ_CONNECT()
It's not a function and requires all its arguments to be build-time
constants. Make this more obvious to the end user to ease confusion.

Change-Id: I64107cf4d9db9f0e853026ce78e477060570fe6f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
a4ec963138 init: use SYS_INIT() where it makes sense
Mostly SoC initialization and some kernel subsystems, but also some
device drivers like the interrupt controllers.

Change-Id: I8dc1844c33acd877c075b6b03558fdca6f87500b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
629e1dd861 init: add SYS_INIT()
This is to be used by subsystem that don't really want to create a
device but rather only want to be initialized automatically during the
kernel init sequence. It is just a wrapper around DEVICE_INIT(), and
thus still uses a device object, but it hides that fact and can be
replaced in the future without changing its model.

It can be used when a device created does not have objects associated
with it, but only an init function, and also when the device name
(DEVICE_INIT(<dev_name>, ...) does not matter.

Change-Id: I5488f430a6fb757cdcb499ef352775dc67aa0565
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
47c04f4ac2 device: rename the device objects created by DEVICE_INIT()
Rename them from __initconfig_XXX to __device_XXX, which is more
indicative of what they are.

Change-Id: Ia63ae40c16a2b6f0413c37863cddc39f04839b72
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
dcfd4e96f4 device: remove obsolete DEVICE_DEFINE/INIT_CONFIG_DEFINE()
They have been replaced by DEVICE_INIT().

Change-Id: I06551f37593a3debb7eb221badd267bb5c7040c0
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
d340d4cb3f device: use DEVICE_INIT everwhere
This is the last step before obsoleting DEVICE_DEFINE() and
DEVICE_INIT_CONFIG_DEFINE().

Change-Id: Ica4257662969048083ab9839872b4b437b8b351b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
ef33dc32e5 device: add DEVICE_INIT()
DEVICE_INIT() is a consolidation of DEVICE_INIT_CONFIG_DEFINE() and
DEVICE_DEFINE(), which are always used in pairs.

Change-Id: I263ac195970483e1bb8bf709ef807ba054db9c32
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
f027902305 net: use DEVICE_GET() instead of referencing __initconfig_xxx directly
Change-Id: I5cca7bf5f882cd2870c53f29dceb64faaf5b0d6e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
f2f719a523 device: move device APIs from init.h to device.h
Change-Id: I7f0d489be95242fe9899a1bfc0f3565839b5ffca
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
a740cd96a9 doc: add device_ namespace to the naming code conventions
Change-Id: I3404a675a965ed196721f3cf825780c607ed2d40
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00