Commit graph

41120 commits

Author SHA1 Message Date
Szymon Janc
7c7b0653bb Bluetooth: Update bt_conn_get_info
Allow to query for connection info in every state. For BR/EDR
connection destination address is valid in every state. For LE
addresses are initialized to BT_ADDR_LE_ANY until connection is
completed.

Change-Id: I0f0abcd0ff0119a82ef8eeb40c8ee3af25eb89b4
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:18 -05:00
Szymon Janc
1a54c49ceb Bluetooth: Fix calling timeout fiber for BR/EDR connection
This timeout is used only on LE link to cancel ongoing LE connection.
For BR/EDR link controller will handle page timeout.

> HCI Event: PIN Code Request (0x16) plen 6
        Address: XX:XX:XX:XX:XX:XX (Sony Mobile Communications AB)
< HCI Command: LE Create Connection Cancel (0x08|0x000e) plen 0
> HCI Event: Command Complete (0x0e) plen 4
      LE Create Connection Cancel (0x08|0x000e) ncmd 1
        Status: Command Disallowed (0x0c)

Change-Id: I6a03da7f935f0c560d57f18abc16069d79e2be69
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:18 -05:00
Grzegorz Kolodziejczyk
25b93e6ccf doc: Update bluetooth SM PICS to PTS 6.4
This patch updates SM PICS to PTS 6.4 version.

Change-Id: I6944698ea4f91d94f69a6968a123e30b106f8164
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:18 -05:00
Grzegorz Kolodziejczyk
de170c0791 doc: Update bluetooth GATT PICS to PTS 6.4
This patch updates GATT PICS to PTS 6.4 version.

Change-Id: I9e1416c1295c273a55a715c7207791e69b36919b
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:18 -05:00
Grzegorz Kolodziejczyk
6c27301146 doc: Update bluetooth GAP PICS to PTS 6.4
This patch updates GAP PICS to PTS 6.4 version.

Change-Id: I3a132ffbb1db0da1b0b882a24ef4adbf2b1a77cf
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:18 -05:00
Johan Hedberg
c9431e17a9 samples/bluetooth: Add sample app for nble implementation
This is almost exactly the same as the peripheral app, except that it
uses CONFIG_NBLE.

Change-Id: Ia6854bce2a0babd03a3ce3251a173ce7ddbfe374
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:18 -05:00
Johan Hedberg
fd975d27fb drivers/nble: Introduce basic skeleton
Introduce the basic skeleton for NBLE, which is the Bluetooth LE API
implementation targeting a custom firmware running on Nordic
Semiconductor nRF51 chips.

Change-Id: I1ce69d6ee0205e71f6bd8d256d9233c93d2cde41
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:18 -05:00
Szymon Janc
76079bc53a Bluetooth: Fix missing negative PIN reply
If connection was not found or PIN handler is not present legacy
pairing should be terminatde with negative PIN reply.

Change-Id: I8a8658f6eb28173537f39226c3792957a28aa7b2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:18 -05:00
Szymon Janc
64450f1933 Bluetooth: Simplify pin_code_reply function
Move PIN checks up to caller and make pin_code_reply handle just
HCI command.

Change-Id: I159aada8f097407d8ccdc53031ea280e69204091
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:18 -05:00
Szymon Janc
d8355793d1 Bluetooth: Simplify pin_code_neg_reply function
There is no need for tracking if connection object exists.

Change-Id: I14047631b4697f892139a414c248542a2b3ae3d6
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:18 -05:00
Johan Hedberg
a524f335fd Bluetooth: Add missing include needed by size_t
Change-Id: Id1f5d3c28d10850072b0963660b851f096598ccf
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:18 -05:00
Szymon Janc
bdbd425d42 Bluetooth: SMP: Remove unused function declaration
Change-Id: I8de54a275a2d5bbc56792bf5f95af8f9e9800018
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:18 -05:00
Johan Hedberg
3f1e253c79 Bluetooth: Reorganize bt_conn to avoid padding
Change-Id: I9163bc532a664c7ba82ce11194e471de162078ea
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:18 -05:00
Arkadiusz Lichwa
d9d26c2d1a Bluetooth: BR/EDR: Always enable security context fields
Always enable in connection object context fields related to security
requirements and encryption.
So far they were enabled only when Kconfig BLUETOOTH_SMP option is on.

Change-Id: Ib7da9ba1df97df5c08b00769c8ba078dfa63ff56
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:25:18 -05:00
Arkadiusz Lichwa
e6bc2ebc98 Bluetooth: Reduce bt_keys size
Makes bt_keys struct more compact saving 4 bytes.

Change-Id: I30976068d546e02f59ae702b477cf8e5086ccec8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:25:18 -05:00
Arkadiusz Lichwa
524ef5ee1d Bluetooth: Refactor type of keys as flags
Converts bt_keys type to atomic_t flags to enable consistent and
compact key type management.

Change-Id: Ie384168da6d5d0d1b305a33988ce7689ba3a4c6a
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:25:18 -05:00
Grzegorz Kolodziejczyk
fa3b78bd07 Bluetooth: tester: Use default address types
Unified bluetooth address types will simplify tester code.

Change-Id: I6d973ff05a8a8dcabb12c9543cd4d747db3e6680
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:18 -05:00
Andrei Emeltchenko
2382ab3db7 Bluetooth: Remove unneeded NULL check
Removing unneeded check makes code consistent since there is check only
in one branch. Moreover since code is executed in tx_fiber frag cannot
be NULL (result of bt_conn_create_pdu()).

Change-Id: Id2f19279f604ad52019d9c334bc29641e4341037
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:18 -05:00
Andrei Emeltchenko
7b3317bb54 Bluetooth: h5: Fix not handling NULL when there is no buffers
In ISR context we receive NULL when there is no free buffers available.
Add handling similar to H4.

Change-Id: I9c1c2784ceaf31a1b2f9433b142a342e8dcdbc3e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:18 -05:00
Ravi kumar Veeramally
d4380a1e40 net: Fix uip debug hex dump format
Print two digits (0 prepended) till 0x0F. Do not print any
count in the beginning of output.

Change-Id: I07e8437f827604565fc8b86d81a105b3986f0a72
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:25:18 -05:00
Ravi kumar Veeramally
810c510664 net: coap: Fix wrong app data
CoAP context send message data pointer is internal to coap.
ip_buf_appdata points &uip_buf(buf)[UIP_IPUDPH_LEN]. coap
internal data pointer assignment to ip_buf_appdata is wrong.
So copy data to ip_buf_appdata.

Change-Id: I3f11da382a227572c9080b210104a5b8e3dc34b4
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:25:18 -05:00
Ravi kumar Veeramally
0a97b09b0e net: samples: Fix BOARD to qemu_x86
Emulation is not supported on basic_minuteia, only qemu_86
supports emulation.

Change-Id: Id1adc6db02aa22c86207db77fb16ac7548e09dac
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:25:18 -05:00
Mariusz Skamra
a91c44417b Bluetooth: tester: Add support for adding CEP descriptors
This patch handles adding of Characteristic Extended Properties
descriptors to tester's GATT database.

Change-Id: Ie1f1c5c5176983250c5fbc97dd44cbe19622b06c
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:18 -05:00
Mariusz Skamra
0fa3b620c5 Bluetooth: tester: Support for adding CCC descriptors
Intentionally only one CCC descriptor will be added to the database.
It's because this meets the conditions to pass PTS tests.

Change-Id: Ic29608e5a9fb4cee0c576d149e5dd26498b365ed
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:18 -05:00
Mariusz Skamra
af8ec50e0d Bluetooth: GATT: Fix warning message
Warning shall indicate that characteristic don't have value,
not descriptor.

Change-Id: Ic368f57ddafb8bad597ec71d3cfcfb9e61fde434
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:18 -05:00
Mariusz Skamra
dd0186c4d0 Bluetooth: GATT: Fix Read By Type response for Include attribute type
In Read By Type response, GATT Server shall send UUID of a included
service only if this service UUID is 16 bit. Otherwise GATT Client
will send Read Request to get 128 bit UUID.

Fix tested with PTS.

> ACL Data RX: Handle 64 flags 0x02 dlen 11     [hci0] 1125351.430506
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Include (0x2802)

< ACL Data TX: Handle 64 flags 0x00 dlen 12     [hci0] 1125351.435346
      ATT: Read By Type Response (0x09) len 7
        Attribute data length: 6
        Attribute data list: 1 entry
        Handle: 0x0002
        Value: 01000200

> ACL Data RX: Handle 64 flags 0x02 dlen 7      [hci0] 1125351.605504
      ATT: Read Request (0x0a) len 2
        Handle: 0x0001

< ACL Data TX: Handle 64 flags 0x00 dlen 21     [hci0] 1125351.613432
      ATT: Read Response (0x0b) len 16
        Value: efcdab89674523b10040510450aa00f0

Change-Id: Ie07ec7930663b04dc134ee1c5a95c4e0670f5926
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:17 -05:00
Mariusz Skamra
4e5d6581c0 Bluetooth: GATT: Split Authorization Permission for Read and Write
According to Core Specification 4.2 Vol 3, Part G, 3.3.3.4,
Server Characteristic Configuration descriptor shall be:
"Readable with no authentication or authorization.
Writable with authentication and authorization defined by a
higher layer specification or is implementation specific."
So there shall be separate authorization permissions
for write and read access.

Change-Id: Ia2850acbb976571743bf96cf9cbe0c1128534073
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:25:17 -05:00
Johan Hedberg
3f667a45f8 Bluetooth: drivers/h5: Further simplify parsing logic
Move rx state to the h5 struct and use a commmon h5_reset_rx() helper
to reset it.

Change-Id: I92af740ae26b443460531b7200dbb0e64fb11d64
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:17 -05:00
Johan Hedberg
19416fb488 Bluetooth: drivers/h5: Rename 'state' to 'link_state'
Change-Id: Ie188cd34d8006f6c83728bf03cdfc71653c7334a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:17 -05:00
Johan Hedberg
c1e49be194 Bluetooth: drivers/h5: Simplify parsing logic
Change-Id: I2a4a4d42329a407a62539a493dfcdaab666231f1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:17 -05:00
Johan Hedberg
20967d3f48 Bluetooth: drivers/h5: Split up h5_unslip_byte() return handling
Change-Id: I2d9a2700e5ac8dfb22ee853adc954a0fe02b8439
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:17 -05:00
Johan Hedberg
9a32952581 Bluetooth: drivers/h5: Remove unnecessary bt_buf_get_sig() helper
Change-Id: I2fd46e325ffba679a0aa27f5b05d4ec9ac67bc13
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:17 -05:00
Johan Hedberg
5559aa13e1 Bluetooth: drivers/h5: Add explicit RECV_RESERVE in Kconfig
Change-Id: Id0957cbe626f54ee167382dab37414467398462d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:17 -05:00
Johan Hedberg
d1117f8575 Bluetooth: drivers/h5: Remove unnecessary SIGNAL state
The handling of SIGNAL and PAYLOAD states is exactly the same. Just
remove the other one.

Change-Id: Id82524812919658c6b1df76a7081c826aaf3df34
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:17 -05:00
Johan Hedberg
ac35dfa7b2 Bluetooth: drivers/h5: Move h5_set_txwin() closer to the point of usage
Change-Id: I63c4816ec0c7a765be7723c3da82dd165b753fa7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:17 -05:00
Andrei Emeltchenko
3dcb3b8cb4 Bluetooth: h5: Recalculate seq number when retransmitting
When packet is retransmitted we need to recalculate sequence number
since it is not stored in the packet buffer.

Change-Id: Id389fa814e82cfd5e39afba1eaeaa79fc9e337f1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:17 -05:00
Andrei Emeltchenko
276258e647 Bluetooth: h5: Fix memory leaks in case of error condition
In a case of unexpected SLIP_DELIMETER we need to discard remaining
bytes in UART and start from beginning.

Change-Id: Ib13a885cc1a4a188057c587e9974aff1d90594c3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:17 -05:00
Grzegorz Kolodziejczyk
fa25591141 doc: Add bluetooth PTS 6.3 PICS file for GATT service
This patch adds document with current supported PICS for PTS 6.3.

Change-Id: I4f8686aeb00ac95d80159d959547cc1fdac072af
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:17 -05:00
Andrew Boie
af11f2aa4a x86: iamcu: fix implementation of disable_interrupts()
Change-Id: I3fe6ab5543f7e10113f9d5eb0fa81217135d5b74
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:17 -05:00
Anas Nashif
b43af743b7 Move compiler optimization to the SoC
Decisions on compiler optimizations were done on the architecture level,
this does not scale and some SoCs will have different optimization levels
or compiler options needed. Moving this to the SoC makes it easy to optimize
differently when using the same CPU which we use to set the right optimization
now on the architecture level.

For IAMCU platforms, use the right architecture and tuning.

-march=lakemont -mtune=lakemont -miamcu -msoft-float

Change-Id: I0f77cffe7a139f8b2620935094437d0dfd160dfe
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:17 -05:00
Anas Nashif
fad531027b kbuild: move SoC Makefile content to Kbuild file
The Kbuild system first looks for a Kbuild file, then it looks for
a make file.
Use the Kbuild for object building and leave the Makefile for definding
build options and compiler flags and other SoC related defines.

Change-Id: I0be59bb5ae02a29108a188efbd6f14dcdb7de4ee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:17 -05:00
Anas Nashif
9be80e3ed6 kbuild: remove linux modules related code
Change-Id: Iddcb74355dc1d6ba0b64a4658bebd4fbb28a6838
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:17 -05:00
Tomasz Bursztyka
86fde21f3b spi: Make the API fully synchronous
The driver has to implement the logic in an interrupt based manner.
Applying the changes to the existing drivers.

Changing ADC's API and implementation as well to follow those changes.

Change-Id: Ie0c3e3e318f619ade6be935adb064a25446cc29c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:17 -05:00
Tomasz Bursztyka
c0205c243c adc: Fix a mistake in result buffer handling
The casting was wrong, resulting in setting only on of 2 slots.
Taking the opportunity to make thing a bit cleaner on the header side.

Change-Id: I3aa90b5f251f3c5aa756681425bb8ab07e3da1b5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:17 -05:00
Andre Guedes
0524af6444 device: Fix typo in Doxygen comments
Change-Id: I76366b057966bbd6e74433be5eab2b3842bb5481
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-02-05 20:25:17 -05:00
Andrew Boie
d9cfbd5a61 interrupts: new static IRQ API
The interrupt API has been redesigned:

- irq_connect() for dynamic interrupts renamed to irq_connect_dynamic().
  It will be used in situations where the new static irq_connect()
  won't work, i.e. the value of arguments can't be computed at build time
- a new API for static interrupts replaces irq_connect(). it is used
  exactly the same way as its dynamic counterpart. The old static irq
  macros will be removed
- Separate stub assembly files are no longer needed as the stubs are now
  generated inline with irq_connect()

ReST documentation updated for the changed API. Some detail about the
IDT in ROM added, and an oblique reference to the internal-only
_irq_handler_set() API removed; we don't talk about internal APIs in
the official documentation.

Change-Id: I280519993da0e0fe671eb537a876f67de33d3cd4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:17 -05:00
Yonattan Louise
4a2ce3c0c9 mingw: change backslashes to forward slashes
If the path of the SOURCE_DIR has the windows format. We change the
backslashes to avoid escaping the characters.

Change-Id: I93247ade884374b292cd34176dee81f53796da8a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:17 -05:00
Louise Mendoza
947fb40ef3 Removing directory link to the source tree.
Removes the symbolic link to the source tree directory that is created
inside the outdir directory.
This link is not being used and is created as a complete copy of the
source tree on windows.

Change-Id: Icd430f3423175151589c15559d57b5ecfc0a0853
Signed-off-by: Louise Mendoza <yonattan.a.louise.mendoza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:17 -05:00
Dirk Brandewie
13075f59bd x86: Replace CONFIG_IAMCU with CONFIG_X86_IAMCU
We are checking against the wrong option, which does not exist.

Change-Id: Ied24daa0930bc4629750ea90f3ac6dbc45e87fff
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:25:17 -05:00
Andre Guedes
e0d353baea i2c: Set I2C_MSG_STOP in i2c_write and i2c_read
This patch changes i2c_write and i2c_read APIs so they explicitly set
the I2C_MSG_STOP flag to their message to ensure that the I2C operation
is actually terminated once that message is sent.

Change-Id: Iea4da35b49ed01bee906679dece8638057d509ff
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-02-05 20:25:17 -05:00