Commit graph

41120 commits

Author SHA1 Message Date
Mariusz Skamra
11b9d98bd2 Bluetooth: tester: Add GAP Unpair command handler
This implements GAP Unpair command handler used to remove pairing
information.

Change-Id: Ia2e2400ea06b2b904f89ec3ee88527d1ea8f7f38
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-10-16 09:01:28 +03:00
Itankar, Piyush T
5ec55f9387 Bluetooth: HCI: Set the Page timeout
The Bluetooth initialization now also sets the page timeout value.

Change-Id: I367591c587bdfe135befc07b637af4cf532f55e2
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
2016-10-16 09:01:28 +03:00
Itankar, Piyush T
5599da97f9 Bluetooth: Kconfig: Option to set page timeout value
Added an option to set the page timeout value. Default the timeout
is set to 5.12 sec.

Change-Id: I196b59f18b9cbf0aaa226ffd85e0bb1699667af2
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
2016-10-16 09:01:28 +03:00
Roger Lendenmann
c839f76e3f Bluetooth: Add well known keys to storage API for legacy pairing
The keys BT_STORAGE_SLAVE_LTK, BT_STORAGE_LTK, BT_STORAGE_IRK allow to store
the distributed bonding keys for ble legacy pairing.

Change-Id: Iaee8b78456e9865a53a2f1228b6afa7ff44bc4db
Signed-off-by: Roger Lendenmann <roger.lendenmann@intel.com>
2016-10-16 09:01:28 +03:00
Mariusz Skamra
c1ba7644f7 Bluetooth: tester: Add Identity Resolved event implementation
This event will be used to inform tester about PTS identity address.

Change-Id: I3d25c69c3fc9a8d8a728497d1dc1d57084373e97
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-10-16 09:01:28 +03:00
Szymon Janc
059e271859 Bluetooth: SMP: Check for connection role before BR/EDR pairing
Master is starting SMP over BR/EDR and it may not be a device that
started BR/EDR pairing. Although specification isn't very clear in this
it seems to be the case when checking TS for cross-transport tests.

Change-Id: I7b0a42ab0123fa444b06a4986f6b1410bf1f2789
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:01:28 +03:00
Mariusz Skamra
09c3d8641d Bluetooth: tester: Rework discovery procedure
This moves discovery logic to the tester application.
BTP Start Discovery command flags have been extended with
"Use observation procedure" bit.
For now, Tester can search for devices in limited/general discoverable
mode or those that are broadcasters by setting corresponding flag bits.

Change-Id: I7142e8fdf40a9081787538e433067335d3ee0564
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-10-16 09:01:28 +03:00
Luiz Augusto von Dentz
e6cb507a42 Bluetooth: IPSS: Remove ipss_listen
This removes ipss_listen since it does depend on the old network stack it
cause build problems with yaip and anyway its code is only used by ipsp
sample while the net samples does not use ipss_listen at all.

Change-Id: I23987670548741bde8800115d473a3bab242153b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-16 09:01:28 +03:00
Luiz Augusto von Dentz
d6acfcf6a0 Bluetooth: L2CAP: Allow receiving fragmented buffers
This enabled L2CAP CoC to store data in fragmented buffers, due to
increase in memory init_17 test has to be disabled ARC for Arduino 101
otherwise sanity test would not pass.

Change-Id: If04289a03e591473de4e722031c1687a14420fc2
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-16 09:01:28 +03:00
Szymon Janc
2caa5f1442 Bluetooth: Track role change for BR/EDR connections
This make sure conn object is using correct role.

< HCI Command: Create Connection (0x01|0x0005) plen 13
        Address: 20:68:9D:60:A1:E4 (Liteon Technology Corporation)
        Packet type: 0xcc18
          DM1 may be used
          DH1 may be used
          DM3 may be used
          DH3 may be used
          DM5 may be used
          DH5 may be used
        Page scan repetition mode: R2 (0x02)
        Page scan mode: Mandatory (0x00)
        Clock offset: 0x0000
        Role switch: Allow slave (0x01)
> HCI Event: Command Status (0x0f) plen 4
      Create Connection (0x01|0x0005) ncmd 1
        Status: Success (0x00)
> HCI Event: Role Change (0x12) plen 8
        Status: Success (0x00)
        Address: 20:68:9D:60:A1:E4 (Liteon Technology Corporation)
        Role: Slave (0x01)
> HCI Event: Connect Complete (0x03) plen 11
        Status: Success (0x00)
        Handle: 11
        Address: 20:68:9D:60:A1:E4 (Liteon Technology Corporation)
        Link type: ACL (0x01)

Change-Id: I65cd8ba36f0e5317d79d7e4d884ee530e1f8b2a3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Johan Hedberg
ba3ab4d2bc Bluetooth: samples: Rename btusb to hci-usb
This prepares the way for more controller-side HCI implementations
which can be named hci-<transport>.

Change-Id: I6f82db4b7b7096a122f32def9fe9025a7b811244
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-16 09:00:57 +03:00
Johan Hedberg
5338ad23b8 Bluetooth: samples/btusb: Rename main c-file
Use main.c as in most other samples.

Change-Id: I82a593d2842e0653279046be181e2770a367ab45
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
8661b7c258 Bluetooth: tests: Add init config for BR/EDR SMP testing
This test build where BR/EDR SMP support is enabled without
LE central or singing support.

Change-Id: I61bc17e989a5752500a7d29557609d9e54b6006d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
c4c55465d5 Bluetooth: SMP: Fix build without signing support
Fix following error if BR/EDR support was build without signing
support enabled.

  CC      net/bluetooth/smp.o
zephyr/net/bluetooth/smp.c: In function 'smp_br_signing_info':
zephyr/net/bluetooth/smp.c:1166:13: error: 'struct bt_keys' has no
      member named 'remote_csrk'
  memcpy(keys->remote_csrk.val, req->csrk, sizeof(keys->remote_csrk.val));
             ^
zephyr/net/bluetooth/smp.c:1166:54: error: 'struct bt_keys' has no
      member named 'remote_csrk'
  memcpy(keys->remote_csrk.val, req->csrk, sizeof(keys->remote_csrk.val));
                                                      ^
Change-Id: I05393c1b2e12c9a66d8ad3e7906d3aa94a57b193
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
f4c2bdeec4 Bluetooth: SMP: Fix build without central role support
If BR/EDR is enabled Pairing Request can also be sent without support
for LE central role.

zephyr/net/bluetooth/smp.c:1326:12: warning: 'smp_br_send_pairing_req'
     defined but not used [-Wunused-function]
 static int smp_br_send_pairing_req(struct bt_conn *conn)
            ^

net/built-in.o: In function `hci_encrypt_change':
zephyr/net/bluetooth/hci_core.c:2006: undefined reference to
     `bt_smp_send_pairing_req'
net/built-in.o: In function `bt_smp_br_connected':
zephyr/net/bluetooth/smp.c:738: undefined reference to
     `bt_smp_send_pairing_req'

Change-Id: I1b68d2412b49f02f42aa146a327252ce107523ca
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Luiz Augusto von Dentz
0817b05203 Bluetooth: L2CAP: Allow sending fragmented buffers
This enabled L2CAP CoC to send buffers that contains fragments.

Change-Id: I898b8375f634d3f0652ec1e7f5a206aa47dd232d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-16 09:00:57 +03:00
Luiz Augusto von Dentz
aca8700f92 Bluetooth: L2CAP: Fix sending buffer with not enough space
l2cap_chan_create_seg attempts to reuse the original buffer but it did
not check if there is enough space in the user_data in order to send
the buffer with bt_conn_send.

Change-Id: Iad54f5868dfce299903f5e392b3ea3b908d1e533
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-16 09:00:57 +03:00
Itankar, Piyush T
5bdaa5ae31 Bluetooth: HCI: Add OpCode definition for setting page timeout
Added a OpCode definition that can be used to change the Page
timeout value.

Change-Id: I6ec06f6114f75665b161206ef3ebabbab193b04f
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
2016-10-16 09:00:57 +03:00
Flavio Santes
3c99454f1e Bluetooth: Fix Kconfig typo
Fix typo found at net/bluetooth/Kconfig.

Change-Id: If606f9911681246162c8ccacd86aa2262883e584
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
b3e1059063 Bluetooth: Start SMP over BR/EDR on pairing complete
When BR/EDR pairing is completed and we are pairing initiator start
SMP over BR/EDR if supported.

Change-Id: I9ff095cb89524693ea0e50a94db41bc1b3ab161f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
c63a50dd4c Bluetooth: SMP: Use separate pool for BR/EDR connections
For SMP over BR/EDR we need BR specific channel context. This doesn't
cost as much as LE context since BR/EDR context is much simpler.
Also this make sure that we have enough contexts for devices that
support concurent LE and BR/EDR connections.

Change-Id: Ied4e3421a29c2fd20643598972dba2ccac5ce82e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
6530535327 Bluetooth: SMP: Fix getting context for BR/EDR pairing
BR/EDR context should be look-up with BR CID.

Change-Id: Id9cdce89b86a9c13015dc71a3a395a02f3d29a9a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Johan Hedberg
5c64037461 Bluetooth: Add BT_STORAGE_ADDRESSES key to storage API
The list of remote devices for which we have information stored can be
retrieved using this key.

Change-Id: I1476c40177b631d6b2b4049623052245b25ed1b3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
0856ef3511 Bluetooth: L2CAP: Treat fixed channel as connected on incoming data
This allows to correctly handle race when remote is sending fixed
channel data before response to Informatino Request was received.

Change-Id: I62e0daa744e11503d31b27f25952ae4ae23d5934
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
cb24f7d53b Bluetooth: L2CAP: Connect optional fixed channel only if supported
Only connect BR/EDR fixed channel if remote indicates support for it.

Core Specification Vol 3. Part A. 4.11:
"An L2CAP entity shall not transmit on any fixed channel (with the
exception of the L2CAP signaling channel) until it has received a Fixed
Channels Supported InfoType from the peer L2CAP entity indicating
support for the channel, or has received a valid signaling packet from
the remote device on the Fixed channel."

If data on fixed channel was received before Information Response then
we connect this channel immediately.

Change-Id: Ifef142c4eb3c14ecffb4abe4836912e2f2aba3c9
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
27731ce222 Bluetooth: L2CAP: Move BR/EDR specific code to l2cap_br.c
This is in preparation for proper handling of fixed channels over
BR/EDR.

Change-Id: I506c365377d5d6bc74f3cf6d257be43c17f22437
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Johan Hedberg
e4f2df013a Bluetooth: Improve storage API documentation
Add missing documentation to storage API.

Change-Id: I17903d75c6b4332e4f9596175587f0068e352b9a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-16 09:00:57 +03:00
Johan Hedberg
7d0eef5f96 Bluetooth: Use proper const type for bt_storage_clear()
The bt_storage_clear() function doesn't modify the data behind the
addr parameter, so the pointer should be decared const.

Change-Id: Icce676f9df80bac26ba4877bb63752559a43339f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
7d4c746093 Bluetooth: L2CAP: Build fixed channels mask on runtime
Build Information Response with fixed channels mask  based on
registered channels.

Change-Id: I47bd3255bd000d3721c77a34c6ea84bbb888630d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Szymon Janc
d84397a27c Bluetooth: L2CAP: Initialize iterator inside for statement
This is more common code convention.

Change-Id: I9283d5a535378ff64f984a6681c9de1fca5f06a5
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-16 09:00:57 +03:00
Anas Nashif
6ce68cb6cb Bluetooth: tests: Limit BR/EDR tests to only qemu
No other board has BR/EDR support at the moment, and we're too easily
hitting RAM limits on them.

Change-Id: I81c800f979d34bd58f73a34c1038a9327556adb2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-15 16:49:04 -04:00
Marcus Shawcroft
f163e11034 tests: Add ethernet drivers to drivers/build_all
Extend the driver build_all tests to include a test for ethernet
drivers.

Change-Id: I2b01d547001d3fae45cda3bc95a74c35fd75ab2b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 16:44:07 +00:00
Marcus Shawcroft
14aa67cbd1 board: Enable ETH_DW for quark_x1000 if ETHERNET is enabled.
There is a convention in the soc implementation for other
(non-ethernet) classes of driver that enabling a generic driver has the
effect of enabling the specific flavour of driver required for the
board.  Extend this convention such that when ETHERNET is enabled, the
quark_x1000 enables the DW ethernet driver.

Change-Id: I525471d259c9582024cd44d6cc4557260abe6451
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-15 16:44:06 +00:00
Marcus Shawcroft
7ee5ce75e9 serial/ns16550: Move RW objects from driver config to driver context.
PCI enumeration modifies pci_dev and port at driver initialization,
these objects move from config_info to driver_data in preparation for
config_info becoming const.

This driver shares a unified uart configuration structure with other
uart device drivers.  The structure uses 'union' and the preprocessor
to customize the structure to the drivers specific requirement.  There
appears to be no compelling reason why all the uart drivers should
share the same (customized) config_info structure.  In order to
re-organize the structure for this driver to get config_info const, an
ns16550 specific config structure is defined and the driver switched
over from the generic uart_config.

Change-Id: I31932d811f623a9370b69903114ae97b15d65886
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 16:44:06 +00:00
Marcus Shawcroft
be6872f5ca spi/dw: Make config structure static.
Change-Id: I15236d62b330ffe2363fa438179fe1f79c168592
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 16:44:06 +00:00
Sonia Leon Bautista
5606f7f424 check_link_map: Removing unsuported python version.
Zephyr uses python 2.7 by default. Phython3 is breaking windows build.

Change-Id: Id0fdbdce89d63f51a0625f5d1f2f45584ecd4023
Signed-off-by: Sonia Leon Bautista <sonia.leon.bautista@intel.com>
2016-10-15 15:09:55 +00:00
Sonia Leon Bautista
e4db6c7af5 win-build: corrects scripts_path for windows build.
Corrects the format for scripts_path from C:/ to /c/ to be added to
PATH correctly.

Change-Id: I2668dff2b9b6f20a25651f629c7a134e9426ee97
Signed-off-by: Sonia Leon Bautista <sonia.leon.bautista@intel.com>
2016-10-15 15:09:54 +00:00
Marcus Shawcroft
c5248a9d26 quark_se: Make ipm console config structure static.
Change-Id: Id8c4c94a76c5a5f7d2a1bcef2059511033f65ee8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:24 +00:00
Marcus Shawcroft
df098b7012 ipm: Make config_info pointers const.
Change-Id: I616c215f98f57d74ba495959d220de6d38ada9d0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:23 +00:00
Marcus Shawcroft
9f308df473 pwm: qmsi: Remove RW data from driver config structure.
Move the RW channel_period object from the driver config structure to
the driver context.  Remove the now empty driver config structure.

Change-Id: I38df7877f1bfb9bb55bcd61e7f35cebb6e4916bd
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:23 +00:00
Marcus Shawcroft
2650747983 serial/uart_qmsi: Make pointers to config_info const.
Change-Id: I667315671aeb8eaa5a5f1e4157c804e9028793de
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:23 +00:00
Marcus Shawcroft
0f1d0d465b i2c/qmsi_ss: Make pointers to config_info const.
Change-Id: I7786f9c65e62eee27395d53b6e923dec6c13f1f4
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:22 +00:00
Marcus Shawcroft
3d32b19726 i2c/qmsi: Make pointers to config_info const.
Change-Id: I95e17cda100c068bfd61e66c568b5adb6f58c42c
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:22 +00:00
Marcus Shawcroft
6b7616698b qmsi/dma: Make config_info pointers const.
Change-Id: I6569049d06853355b73735bfddedc827e4764780
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:21 +00:00
Marcus Shawcroft
b8d6ce241c qmsi/dma: Remove unused channel[] from config_info
Change-Id: Iab5f976c61674f6955d50a882911c790eba3fb21
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:20 +00:00
Marcus Shawcroft
2d1678c632 gpio/sam3: Move RW data from driver config to runtime.
The callback list within the driver config is updated dynamically
hence the list itself cannot be const.  Create a runtime context
driver data structure and relocate the callback list to the new
structure.

Change-Id: Ied20846e6a78e43967239afa7797456a9abd8548
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:19 +00:00
Marcus Shawcroft
389e606b06 i2c/sam3: Make config_info pointers const.
Change-Id: I5e388ff91430d052c84553a8cf9ece12cae29993
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:19 +00:00
Marcus Shawcroft
8ea6287c0b quark: ipm: Make driver config structures static.
Change-Id: I2d4977aaea9df969fd8edb4b07310e472e6c6917
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:18 +00:00
Marcus Shawcroft
e1a7b47111 tests: test_ipm: Make device config structures static.
Change-Id: Ief7a411af8dd48b9c6b7122d3062c12f3fa28c66
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:16 +00:00
Tomasz Bursztyka
fb24857b5c tests: Add a unit test for the byteorder buffer swap utilities
sys_memcpy_swap() and sys_mem_swap are tested.

Change-Id: Ib7ee9bd5e58a17cb41960c1834510d6643dc8271
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-10-15 10:13:36 +00:00