Commit graph

42249 commits

Author SHA1 Message Date
Andre Guedes
54337aa736 test: Convert returning code to errno.h
Change-Id: Ib4e3fb2e3c1cecf7e1646c7dc03b16e9ce4b6da2
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-23 15:49:40 +00:00
Andre Guedes
db2e46319f arch: Convert returning codes to errno.h
This patch replaces all occurrences of DEV_* codes by errno.h codes at
the arch layer.

Change-Id: I1a1ab6d0481f3660ad032e2690d2577245fe1f34
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-23 15:49:40 +00:00
Andre Guedes
0cf74d1755 device: Deprecate DEV_* error codes
This patch adds a comment to DEV_* codes definition to inform that these
codes are deprecated and we should use codes from errno.h instead.

Change-Id: Ia01b83035db5526b2da56ad4a06b2ebab85b0d55
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-23 15:49:40 +00:00
Maciek Borzecki
25799f045c benchmark/latency: reduce RAM requirements
Reduce RAM requirements of latency benchmarks by reducing the amount of
memory statically allocated for stacks (both fiber and task). This helps
reduce the memory usage required by microkernel test to below 20kB,
enabling the benchmark to be run on Nucleo-F103RB board. The change was
verified for nucleo_f103rb and qemu_x86 boards.

Change-Id: If5990d107f0fcfabd12ade82f97e7a1a13f8421c
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Maciek Borzecki
b7ca3fac3d benchmark/latency: support for Cortex-M targets
Remove x86 specific includes. Add Cortex-M specific instruction pipeline
flush helper.  Microkernel benchmark has been verified to work on STM32
MINI A15 (STM32F103VET) board. Due to memory constraints, Nucleo-F103RB
can only run a nanokernel version of the benchmark.

Change-Id: I2e49c240d6985ceb5643551397d6e0a8cc65b3c6
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Maciek Borzecki
c97906cba6 boards/stm32_mini_a15: default to 115200 for USART1 speed
Change-Id: Ie4ff6bd5559ee2861201e2137986430d6221e564
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Maciek Borzecki
a4808956fc boards/nucleo_f103rb: default to 115200 for USART2 speed
Change-Id: I72618afc33665cc17f7a230f9dada5666a4ded8e
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Maciek Borzecki
fa31a240c8 boards/nucleo_f103rb: enable 72MHz system clock by default
Enable 72MHz SYSCLK by default. The board does not have an on-board
quartz, however the STLink frontend produces a 8MHz clock signal that we
can use. Since the clock signal is not coming from an oscillator, HSE
bypass must be enabled. Make sure not to exceed 36MHz clock on APB1 bus.

Change-Id: I6b0b499a1cc4b0deccbfa374fc9ca3e3e8cc38c5
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Maciek Borzecki
7823380710 boards/stm32_mimi_a15: enable 72MHz system clock by default
Enable 72MHz SYSCLK by default. We use the fact that there is an
on-board 8MHz quartz oscillator available as HSE clock signal. Make sure
not to exceed 36MHz clock limit on APB1.

Change-Id: I9ebc2144910253e68cd8a9b078884852f01c2cab
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-23 11:47:36 -04:00
Daniel Leung
5b8c5fcc48 arm/fsl_frdm_k64f: remove kconfig default "n" for PWM
CONFIG_PWM is set to "no" by default, so there is no need
to do it in the SoC kconfig file. Also, setting CONFIG_PWM
there causes kconfig to think that CONFIG_PWM depends on
CONFIG_SOC_FSL_FRDM_K64F and gives warnings about
unmet dependencies if the certain combinations of CONFIG
are set.

Change-Id: I0028accfc4b585dcfa87e0d5733b789691a598e3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-23 15:43:22 +00:00
Yannis Damigos
f4d6dbb211 drivers: pinmux: Restructure kconfig options
Moves config options for K64 into its own config file under its
own submenu.

Change-Id: I94ccac54709ab5ec8222daa8634818d9ebc3561d
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-23 15:36:43 +00:00
Yannis Damigos
f978d37466 drivers: spi: Make K64 spi submenu available only for K64 soc
Makes K64 spi driver submenu available only if K64 soc is
selected.

Change-Id: I0ada8863a592f056dbe48e78d9374f2348dcac14
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-23 15:36:43 +00:00
Yannis Damigos
489477b6b9 drivers: pwm: Make K64 pwm submenu available only for K64 soc
Makes K64 pwm driver submenu available only if K64 soc is
selected.

Change-Id: I9959b4785c6deab01977f86bbbebe3d671a4eec7
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-23 15:36:42 +00:00
Andrew Boie
e57a1e5622 sanitycheck: don't require arch.ini blocks for every platform
If the arch ini file doesn't have a specific block for the platform,
just assume all defaults.

Change-Id: Id6ab1ede8936bdd6006a5c4fd2f9a4f6aaf42478
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-23 15:35:38 +00:00
Andrew Boie
821d832f6d sanitycheck: allow N platforms per arch to be run
It is an unfortunate fact of life that our CI machines are often
severly underpowered virtual machines that take quite some time
to run sanitycheck --all. The only other option was to just use
the default test case filtering semantics which chose one platform
per arch to test.

Now it is possible to specify N platforms per arch with the new
--platform-limit option, allowing greater flexibility on how many
tests will be run.

The counter-intuitive use of '--platform all' or '--platform default'
is no longer supported as these use-cases are covered by other
command line options.

Change-Id: I45b0050df52e1a22e75534a3876d89e3c77698c9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-23 15:35:38 +00:00
Szymon Janc
6f9ce0b417 Bluetooth: Provide more config options to init sample
This allows to excersize different kconfig configurations in
single app. Thanks to this other samples don't have to get
extra extra options enabled just to improve test build coverage.

Change-Id: Ie5d261f3d38c60e227cf963d938b6fac6d0fb3b9
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-23 12:50:30 +00:00
Arkadiusz Lichwa
dc6085667e Bluetooth: BR/EDR: Fix storing legacy link key
Stores in keys database legacy (Pre-SSP) link key.

Change-Id: I848e0e29e22edacb24c1a26ffed7a68dff08fed8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-23 11:54:29 +00:00
Szymon Janc
b1e6bb5ef7 Bluetooth: Compile only required parts of keys support
Depending on BR/EDR and SMP support only subset of keys functionality
is needed. This fix compilation if SMP is disabled and BR/EDR is
enabled.

Change-Id: Icf4b5ad1a214e514e03c4c9a359d151e69cab2ab
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-23 10:36:28 +01:00
Szymon Janc
824ec04ea4 Bluetooth: Build keys support if BR/EDR is enabled
BR/EDR requires keys support.

Change-Id: I890b4e56e4e4808cab5579ed280529e11de2cb66
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-23 10:36:28 +01:00
Johan Hedberg
cb5f5d2423 drivers/nble: Fix validation of advertising parameters
According to the Core Sepcification, Advertising Interval Min/Max
shall not be set to less than 0x00a0 if ADV_SCAN_IND or ADV_NONCONN_IND
type is used.

Change-Id: I6c4ef4f73b82841c3a96694dda670cdd12a40a54
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-23 06:14:30 +00:00
Luiz Augusto von Dentz
7a585ee137 Bluetooth: CTS: Add service sample
This adds a CTS service sample which can be shared with application
samples.

Change-Id: I38889f71f6ce8fc7b784d0d04af6c97408e2d662
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-22 17:26:49 +00:00
Luiz Augusto von Dentz
6d461204bf Bluetooth: BAS: Add service sample
This adds a BAS service sample which can be shared with application
samples.

Change-Id: I1f484dadf63b41632992454a40edd91077bb78fa
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-22 17:26:29 +00:00
Luiz Augusto von Dentz
265fc8703a Bluetooth: DIS: Add service sample
This adds a DIS service sample which can be shared with application
samples.

Change-Id: I66f7a725139c8fa381275c3bda5e7c79fa3f09c8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-22 17:26:15 +00:00
Luiz Augusto von Dentz
97e1938db9 Bluetooth: HRS: Add service sample
This adds a HRS service sample which can be shared with application
samples.

Change-Id: I1d2022ee7a6dfa46e2cae2d7c9d7924140d4fe37
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-22 16:43:10 +00:00
Luiz Augusto von Dentz
47bb494610 Bluetooth: Make application samples to use GAP Service sample
This reduces the amount of duplicated code across sample applications.

Change-Id: I20cf2e9f948f1420f234a58beb7f72ad74696cf8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-22 16:43:02 +00:00
Vinicius Costa Gomes
7f68afe382 k64f: Move pinmux specific code to pinmux.c
This makes this board more consistent with the rest of the code base.

Change-Id: I5641c6358e638a3585d2154e67d3536b11436e01
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-03-22 15:17:13 +00:00
Mariusz Skamra
3d35533c95 Bluetooth: Fix validation of advertising parameters
According to the Core Sepcification, Advertising Interval Min/Max
shall not be set to less than 0x00a0 if ADV_SCAN_IND or ADV_NONCONN_IND
type is used.

Change-Id: Ib10f7ec8cdf92dd67e602a9b57d20a35ebacde4e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-22 15:16:12 +00:00
Yannis Damigos
d7a21260b6 drivers: gpio: Make K64 gpio submenu available only for K64 soc
Makes K64 gpio driver submenu available only if K64 soc is
selected.

Change-Id: I4097006a4dca718ed2da730fa85cd2ad9970f419
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-21 19:41:06 +02:00
Yannis Damigos
3a977ae654 drivers: gpio: Move STM32 gpio driver under its own submenu
Moves STM32 gpio driver under its own submenu, like atmel SAM3
and K64 gpio drivers.

Change-Id: Iebc474af9818a73275f99183d3f4788eea1e6ded
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-21 16:51:43 +00:00
Maciek Borzecki
f607954dbc arm: access svc instruction using halfword load in svc_handler
Use of `ldr` triggers unaligned memory access when loading SVC
instruction to r0. This is caused by the fact that SVC is a 16-bit
instruction, hence with a 2 byte offset, we are performing an non-word
aligned access. Prevent this by using `ldrh` to load a halfwords rather
than full words.

Change-Id: Ieae60c2ce86c6cfe15c89627d3a450797ce7e714
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-21 16:36:13 +00:00
Maciek Borzecki
61c0363257 clock_control/stm32f1: HSE support and PLL configuration cleanup
Add support for use of HSE (incorrectly named PREDIV1)as input of PLL,
along with HSE bypass for stabilized external clock, and XTPRE
prescaler. Update PLL handling so that we do not unnecessarily enable
PLL clocks, instead enabling only the clocks sources that are required
as per user's configuration.

This change allows higher SYSCLK clock values, up to 72MHz.

Change-Id: Ia7c2be3ce11ac0de2efa664b20e7ab5fddd57a51
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-21 16:36:13 +00:00
Maciek Borzecki
7205070402 soc/stm32f1: add embedded flash registers mapping
Add mapping of registers for embedded flash controller.

Change-Id: I81f891551124e9f124ff59dfe0b3c737ec5b3b63
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-21 16:36:12 +00:00
Jukka Rissanen
3f9e87c318 net: contiki: Check IPv6 extension header length
If the received packet is corrupted and the IPv6 extension
header is too big, then just discard the packet.

Change-Id: I5071fc48a927d14f02ed3dda199f67c095d05b91
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-21 15:40:29 +00:00
Jukka Rissanen
746f81be1b net: 6lowpan: Check packet size before accepting fragment
If the fragment is corrupted and tells that the total packet
size is too big, then we must discard the packet.

Change-Id: I6257d677d1d2cfc30f37ad6fe4d59051d0e041ef
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-21 15:40:29 +00:00
Arkadiusz Lichwa
158cdbf91a Bluetooth: Fix checkpatch error/warnings
Fixes some checkpatch's errors/warning in HCI stack code.

Change-Id: I105fb491b5509f72549ab788764b1386ce3af47f
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 14:48:40 +01:00
Grzegorz Kolodziejczyk
5a3d40beec Bluetooth: tester: Add LE scan type flags and support
Now start discovery GAP function interprets scan type flags (active,
passive) and starts discovery with specific LE scan parameters.

Change-Id: Iecb942e24d68790966afe893d3543433c33192dc
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-03-21 11:17:50 +00:00
Mariusz Skamra
9c23e24da5 Bluetooth: tester: Refactor Set Value command handler
Since user_data can be added with gatt_db_add, Set Value
command handler can be simplified.

Change-Id: I86d3ed411cc897488e9073492ff85e0754b2ab93
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-21 11:17:15 +00:00
Arkadiusz Lichwa
b0bc48370d Bluetooth: BR/EDR: Add no-bond keys flag
When bond is required only for current connection session, don't store
the link key value in keys database when such link key is generated.
Release the link key storage on disconnection complete.

> HCI Event: IO Capability Response (0x32) plen 9
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	IO capability: DisplayOnly (0x00)
	OOB data: Authentication data not present (0x00)
	Authentication: No Bonding - MITM required (0x01)
> HCI Event: IO Capability Request (0x31) plen 6
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
< HCI Command: IO Capability Request Reply (0x01|0x002b) plen 9
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	IO capability: KeyboardOnly (0x02)
	OOB data: Authentication data not present (0x00)
	Authentication: No Bonding - MITM required (0x01)
> HCI Event: Command Complete (0x0e) plen 10

Change-Id: Ibd29457a9183f33f28264b857dd2de01f96d266f
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:13:12 +00:00
Arkadiusz Lichwa
14abcf8281 Bluetooth: BR/EDR: Set user mode flag on User Passkey Entry
Adds user flag to enable a user to input interactively requested
passkey and releases the context flag after user interaction is
finished.

Change-Id: I5822ebdf5a7a78578d927d8b0cb272656cb26142
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:12:30 +00:00
Arkadiusz Lichwa
6f30525278 Bluetooth: BR/EDR: Handle User Passkey Entry event
Enables handle request from remote to enter passkey by the user to
continue SSP authentication process. It happens when local device
supports 'keyboard only' functionality. Otherwise the response is
negative.

> HCI Event: IO Capability Response (0x32) plen 9
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	IO capability: DisplayOnly (0x00)
	OOB data: Authentication data not present (0x00)
	Authentication: Dedicated Bonding - MITM required (0x03)
> HCI Event: IO Capability Request (0x31) plen 6
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
< HCI Command: IO Capability Request Reply (0x01|0x002b) plen 9
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	IO capability: KeyboardOnly (0x02)
	OOB data: Authentication data not present (0x00)
	Authentication: Dedicated Bonding - MITM required (0x03)
> HCI Event: Command Complete (0x0e) plen 10
	IO Capability Request Reply (0x01|0x002b) ncmd 1
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: User Passkey Request (0x34) plen 6
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
< HCI Command: User Passkey Request Reply (0x01|0x002e) plen 10
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	Passkey: 599207
> HCI Event: Command Complete (0x0e) plen 10
	User Passkey Request Reply (0x01|0x002e) ncmd 1
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Simple Pairing Complete (0x36) plen 7
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Link Key Notification (0x18) plen 23
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	Link key: 560e9c31d700ae5576af83d1e079e911
	Key type: Authenticated
	Combination key from P-192 (0x05)

Change-Id: Ia15517519b326eede29bc8e71edb7ec6ca77e010
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:12:01 +00:00
Arkadiusz Lichwa
143a826b1e Bluetooth: BR/EDR: Handle User Passkey Notify event
To allow remote, typically a keyboard, input on its side common
passkey during SSP authentication, enable generated passkey value by
local controller to be notified to user interface if available.

> HCI Event: IO Capability Response (0x32) plen 9
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	IO capability: KeyboardOnly (0x02)
	OOB data: Authentication data not present (0x00)
	Authentication: No Bonding - MITM required (0x01)
> HCI Event: IO Capability Request (0x31) plen 6
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
< HCI Command: IO Capability Request Reply (0x01|0x002b) plen 9
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	IO capability: DisplayYesNo (0x01)
	OOB data: Authentication data not present (0x00)
	Authentication: No Bonding - MITM required (0x01)
> HCI Event: Command Complete (0x0e) plen 10
	IO Capability Request Reply (0x01|0x002b) ncmd 1
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: User Passkey Notification (0x3b) plen 10
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	Passkey: 831705
> HCI Event: Simple Pairing Complete (0x36) plen 7
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Link Key Notification (0x18) plen 23
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	Link key: 1a8d1c80409c4466b3423ca2bb761cf4
	Key type: Authenticated Combination key from P-192 (0x05)
> HCI Event: Encryption Change (0x08) plen 4
	Status: Success (0x00)
	Handle: 11
	Encryption: Enabled with E0 (0x01)

Change-Id: I1e8ad5d75181ceb9c93576b9e9b93975d9cdf35b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:11:49 +00:00
Arkadiusz Lichwa
cac53e057f Bluetooth: BR/EDR: Set user mode flag on User Confirmation event
During handling User Confirmation request, set user flag to allow stack
handle interaction with user authentication callback mechanism.

Change-Id: I7779e3dd8e5cee4caf9f182f02c7409bb5bb8c61
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:11:34 +00:00
Arkadiusz Lichwa
029820c926 Bluetooth: BR/EDR: Check security on SSP authentication
Rejects by negative reply to authentication request if HIGH
security is required on local and both devices IO Capability values
disallow to interact with user.

Change-Id: Ia670d0b3c5c66a27175f4f5f38cd56e845e393b0
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:11:17 +00:00
Arkadiusz Lichwa
7b2799da1c Bluetooth: BR/EDR: Handle User Confirmation Request event
Enables processing, as pairing acceptor, user interactive passkey
confirmation request if local and remote IO Capabilities supports
'display yes/no'. Based on such validation, both parties can confirm
interactively passkey value or JustWorks (auto-accept) model is used.

> HCI Event: Command Complete (0x0e) plen 10
	IO Capability Request Reply (0x01|0x002b) ncmd 1
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: User Confirmation Request (0x33) plen 10
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	Passkey: 565990
< HCI Command: User Confirmation Request Reply (0x01|0x002c) plen 6
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Command Complete (0x0e) plen 10
	User Confirmation Request Reply (0x01|0x002c) ncmd 1
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Simple Pairing Complete (0x36) plen 7
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)

Change-Id: Ice7a57a1c6150c10ea22402554954ed84aa94d0e
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:10:47 +00:00
Arkadiusz Lichwa
02f541dfc5 Bluetooth: BR/EDR: Reply to IO Capability request
For now as local host works as pairing acceptor, the pairing context
flag is set when remote IO Capabilities is received.
Reply to the request uses remote's authentication requirement
cross-checked against predefined authentication methods that are based
on local and remote IO capabilities.

> HCI Event: IO Capability Response (0x32) plen 9
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	IO capability: NoInputNoOutput (0x03)
	OOB data: Authentication data not present (0x00)
	Authentication: No Bonding - MITM not required (0x00)
> HCI Event: IO Capability Request (0x31) plen 6
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
< HCI Command: IO Capability Request Reply (0x01|0x002b) plen 9
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	IO capability: DisplayYesNo (0x01)
	OOB data: Authentication data not present (0x00)
	Authentication: No Bonding - MITM not required (0x00)
> HCI Event: Command Complete (0x0e) plen 10
	IO Capability Request Reply (0x01|0x002b) ncmd 1
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)

Change-Id: I0f95a58178618f06de16cce0e9d9cf6c85209677
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:09:55 +00:00
Arkadiusz Lichwa
befb051595 Bluetooth: BR/EDR: Validate remote requirements
According Core Spec 4.2 [Vol 2 Part E, 7.7.41], remote authentication
and IO capability requirements have defined valid ranges.

Change-Id: I0f7cfb79097abbf96b3fee79a757431b6beef665
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:03:00 +00:00
Arkadiusz Lichwa
4e063354e9 Bluetooth: BR/EDR: Mark P-192 EC link key as AUTHENTICATED
When link key generated by controller is derived from applied
non-JustWorks authentication method by using P-192 elliptic curve (EC)
algorithm, mark it as authenticated.

< HCI Command: User Confirmation Request Reply (0x01|0x002c) plen 6
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Command Complete (0x0e) plen 10
	User Confirmation Request Reply (0x01|0x002c) ncmd 1
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Simple Pairing Complete (0x36) plen 7
	Status: Success (0x00)
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Link Key Notification (0x18) plen 23
	Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
	Link key: 1f0a22d608ee0025c2faea0282bd2479
	Key type: Authenticated Combination key from P-192 (0x05)

Change-Id: Id2afbdc9eb1b2ef66e850c4a53b91187b88e5c6b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:02:12 +00:00
Arkadiusz Lichwa
3f6fdacdc6 Bluetooth: BR/EDR: Reuse link key if available
When link key exists in keys database and subsequent connection wants
to use it, reassign such link key to corresponding connection object.

< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
	Address: 68:17:29:CF:5D:86 (Intel Corporate)
	Role: Slave (0x01)
> HCI Event: Command Status (0x0f) plen 4
	Accept Connection Request (0x01|0x0009) ncmd 1
	Status: Success (0x00)
> HCI Event: Connect Complete (0x03) plen 11
	Status: Success (0x00)
	Handle: 72
	Address: 68:17:29:CF:5D:86 (Intel Corporate)
	Link type: ACL (0x01)
	Encryption: Disabled (0x00)
> HCI Event: Link Key Request (0x17) plen 6
	Address: 68:17:29:CF:5D:86 (Intel Corporate)
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
	Address: 68:17:29:CF:5D:86 (Intel Corporate)
	Link key: 62329a517ec1664361c6578e67e71f22
> HCI Event: Command Complete (0x0e) plen 10
	Link Key Request Reply (0x01|0x000b) ncmd 1
	Status: Success (0x00)
	Address: 68:17:29:CF:5D:86 (Intel Corporate)
> HCI Event: Encryption Change (0x08) plen 4
	Status: Success (0x00)
	Handle: 72
	Encryption: Enabled with E0 (0x01)

Change-Id: I409904dc739e600d3418f7d3ffb1a2dc9ea3a411
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-03-21 11:01:59 +00:00
Szymon Janc
d4edd35d26 Bluetooth: Add name resolving HCI commands definitions
Change-Id: Id5ba3ca3929b604031a1bcbb898036a5c8ed3a3b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-21 10:34:12 +00:00
Szymon Janc
6f7234d62a Bluetooth: Fix HCI EIR event definition
Extended Inquiry Result Event shall always have one report so there is
no need to iterate over array.

Change-Id: Id6c550074395666b36d4dc6b956c9e4ae4154938
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-03-21 10:33:32 +00:00