Commit graph

18576 commits

Author SHA1 Message Date
Szymon Janc
3b5bae6b96 Bluetooth: Fix tester application automated build
Due to bug in test case configuration file tester application
was not build by 'Build Automation'. This application has all
Bluetooth debugs enabled so it is essential for build verification
process.

Change-Id: I51115d17a28614b7746c6d207d4362a94bc0f591
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Andrei Emeltchenko
7a504e9a62 Bluetooth: Fix wrong buffer allocation result
Change-Id: I5db2e320e3fb83b9ea41c03053c3ce5b0bbf2bcd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:15:37 -05:00
Grzegorz Kolodziejczyk
6e2132f724 Bluetooth: Separate char to hex helper
This patch separate character to hex character convertion part and
moves related code to helper.

Change-Id: I5c754669583228566e80a9b20a9db0e639641677
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
31baaa9a18 Bluetooth: Fix compilation error with debugs enabled
This fix following build error:
  CC      net/bluetooth/hci_core.o
In file included from net/bluetooth/hci_core.c:43:0:
net/bluetooth/hci_core.c: In function 'update_conn_params':
net/bluetooth/hci_core.c:751:49: error: 'evt' undeclared
     (first use in this function)
  BT_DBG("status %u, handle %u,features 0x%x\n", evt->status, handle,

Change-Id: Ic3c15d17c73b26d44913327df577495afc80f356
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Arkadiusz Lichwa
87b219cc05 Bluetooth: Update LE Exchange Features event handler
Adds conditions to trigger L2CAP based Update Connection Parameters
and HCI based Connection Parameters Request Procedure.

Change-Id: I66e4a977b534afc4a10d4eba54ee3eb95c2166ef
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:15:37 -05:00
Arkadiusz Lichwa
d3dc91e73a Bluetooth: Initiate LE Exchange Remote Features
Adds host bits to initiate LL LE Exchange Feature procedure if
supported. Both the master and slave can initate it for controllers
newer than 4.0. For 4.0 controllers only master can do that.
Inform upper stack layers of the slave about the connection is ready
to use only when LE Exchange Feature isn't supported. Otherwise
upper layers shall be notified about new connection when Connection
Parameters Update procedure is finished.

Change-Id: Ief29744e498873f79fc6f62f98c083fecaeae24e
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:15:37 -05:00
Mariusz Skamra
2b2e67a220 Bluetooth: Move connection callbacks to the conn.c
Since then bt_conn_connected as well as bt_l2cap_disconnected callback
can be called from bt_conn_set_state directly.
Also connected cb could be called from there, however
eg. introduction of some additional state is required TBD.

Change-Id: Ida6906272e1468ef5b41ba8dba2a936db049d308
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:15:37 -05:00
Mariusz Skamra
7682d1579f Bluetooth: Make bt_l2cap_update_conn_param to be non-void function
Makes bt_l2cap_update_conn_param to return an error if command was not
sent.

Change-Id: Ie7351040bd371bb161afc2f2a2c10e015bcdc8e4
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
e6b32cd098 Bluetooth: SMP: Use flag for tracking if encryption pending
There is no need to have sparate bool in context structure while
flags field is available.

Change-Id: Ib1bcf9794c32268897b0a873787566a620f3097b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
8e645f9e7c Bluetooth: Use connection reference as free indicator
If ref is zero other struct bt_conn fields should be considered
garbage. Using ref count instead of address is also faster.

Change-Id: Ic3b30c0fdbce8f93f81095d3671be0e54eac1455
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
2d4aac58f5 Bluetooth: Update authentication support in shell application
This allows to select more authentication options and reply
to all requests.

Change-Id: I220d945763b9381818c5caad52bf0f5e8b01ab54
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
6486ae7943 Bluetooth: SMP: Verify MITM requirements in security request
If slave is requesting MITM protection verify if LTK is authenticated
before enabling encryption.

Change-Id: I6642f88945b0ca0310880935edbcfa2a6764c8d8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
25973ac160 Bluetooth: Fix setting security level on encryption
If authenticated key was used for encryption resulting security
level is high. If resulting security level is lower then
requested level link is disconnected.

Change-Id: Ib66f722e6bb52e943d2b5cefb58f018707ce725b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
b73d408b72 Bluetooth: Fix requesting high security level
If high security is required but keys are unauthenticated start
pairing instead of encrypting with too weak keys.

Change-Id: I35e5f0c1ab86660479288908152d61823ffb102e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
74a1f0fe2e Bluetooth: SMP: Verify if required security level is reachable
There is no point in initializing security if required security level
is not reachable due to local IO capabilities.

Change-Id: I00d3cc552fcce4d1aac9498c90dcd826735dcb2b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
4020511af7 Bluetooth: Store if generated keys are authenticated
This allows to store information if key was generated during
authenticated or unauthenticated pairing.

Change-Id: Idd398749c869e6278bf10909cfb768ba09565d54
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Ravi kumar Veeramally
e5bb0f9bdd net: tools: Add 15.4 monitor tool support
This monitor_15_4 tool is run in the host side. It will connect
to Zephyr via UART using pipes. Test app1 in qemu send data
through the uart and pipe, this tool read data from pipe1
and writes it to pipe2 where test app2 running in qemu2
will read data from it and vice-versa. In between tool store
data in pcap format for further wireshark packet analyzation.

Change-Id: If5c998591edf4253fbd5e249c6c9e48fa1792715
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:15:37 -05:00
Ravi kumar Veeramally
048464b756 net: 15.4: Fix trivial errors in dummy radio
Cache input type and validate TLV according to it. Check
uart_send return values.

Change-Id: Ib1f784a776176763773fead2d464330a4325ba19
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
84e9c1ec69 Bluetooth: SMP: Report failure only for authenticated pairing
If JustWorks pairing is used for pairing don't report failure.

Change-Id: I23cee54a74dd021c1f273d987ca67066452d7801
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
765ad1f6b9 Bluetooth: SMP: Add flags for tracking state
Flags for indicating if stored TK is valid and if confirm sending
was delayed are required for properly handling passkey entry input.
This is to avoid using incorrent TK or sending SMP commands in invalid
order.

Change-Id: I11e162331e93311f292f0723fc9f860c753d7d96
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
01c76d9fa4 Bluetooth: SMP: Add support for passkey entry
This allows to request passkey being entered by user.

Change-Id: I6a56c65ca689473659a13c19f8578058476d2685
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc
7d392f7a6d Bluetooth: SMP: Add support for tracking pairing method
This allows to track which pairing method was used and is
a preparation for storing information if resulting keys
are authenticated.

Change-Id: Ib9fc762d19bd4add6f0b431745eeb9e2780016d4
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Luiz Augusto von Dentz
a9d6a816e8 Bluetooth: ATT: Be more consistent with bt_buf variable names
This makes the code more consistent by always trying to name bt_buf
variables as buf.

Change-Id: I10d54260c5cf2f6aea5300668d5eb68f3da2a8ba
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:15:37 -05:00
Jukka Rissanen
2a97e28aa4 net: apps: dtls-client test application
The dtls-client app will run in Zephyr and will send network
packets to host process (dtls-server) via SLIP.

Change-Id: I51e3424193e6a7169d9921ba56466bb0c0c0d4d1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:37 -05:00
Jukka Rissanen
d5f3415562 net: tools: Add dtls-server test application
This dtls-server app is run in the host side. It will
connect to Zephyr via UART using SLIP. The app will
listen DTLS data in socket 4242 and will reverse the returned
bytes and send them back to the sender. The application
supports both IPv4 and IPv6 protocols.

Change-Id: I8d37b0d3318bf6a3a5365e7d2c64eae83a1f3285
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:36 -05:00
Tomasz Bursztyka
9d0af1c270 spi: Intel spi driver fixes
- Handle the new error callback type, a ROR interrupt is irrecoverable.
- Removing the fifo pre-fill: this should never be done that way. It's
  up to the controller to request via an interrupt to get its fifo
  filled-in. (TFS bit on SSSR register is the one requesting such
  filling)
- Disabling the controller once completed (following transfer will
  re-enable it)
- Removing useless debugging info

Change-Id: I466a8efb65a41f3315a6a36e10ea519d0c4b01e9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:36 -05:00
Tomasz Bursztyka
1804292f6d spi: Add an error callback type
Such type will be used in case of unrecoverable error on driver side
while transceiving.

Taking the opportunity to fix spi_transceive declaration as it should be
static.

Change-Id: I7392f93b34cf6d74900c844607cf03e741837876
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:36 -05:00
Constanza Heath
7d0e1d9218 Add initial import of TinyCrypt crypto library and tests
Change-Id: I89b8db6925385dd02e95e0401bc42f32543e0daf
Signed-off-by: Constanza Heath <constanza.m.heath@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Anas Nashif
71ad87c7d0 loapic: add LOAPIC_DEBUG for debugging loapic
Change DEBUG option into something more specific.

Change-Id: If1f421fbf7d234ad6bfac410697205d5d74548c0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Anas Nashif
476a823c94 loapic: cleanup comments
Change-Id: I98c5ffea85fb951d993bcb6f7f6fe305a419d03a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Anas Nashif
e81942e538 arc: do not include arch/cpu.h, nanokernel.h has it
Change-Id: Ic8537168211292fcedcb9c1d283d638029473932
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Anas Nashif
a07a7903fd Remove serial options dependency on X86_32
Menu depends on X86, however some options are available
for all architectures.

Change-Id: I09cad39811319022d0323a4ff87d415346b5630a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Anas Nashif
a2c88abf63 Add dropped GDB_INFO option
This option is being referenced all over the code but is not
being defined in Kconfig.

Change-Id: I181668ce7a35819804b8e6261f6cf27088843377
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Juan Manuel Cruz
6525b656cd arc registers: fixes the macros to read arc registers
This commit fixes small errors on the asm implementation of arc
register reading and the built-in functions call.

Change-Id: Iea2df715eaefb25095770971ac03d441311abf16
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:15:36 -05:00
Anas Nashif
8e6e3dd380 make disabling nested interrupts configurable
Change-Id: I43b8e2e20f8c9ad3923415b943dc5a7c97bd0121
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Tomasz Bursztyka
26e7aaf1f1 ia32: Removing useless inByte/outByte declarations
ns16550 was the only driver using those, and now that it properly uses
sys_io.h functions we can remove inByte and ouByte from ia32's board.h
files.

Change-Id: Id2a691b8ecf43baacd64bc9be09feb15ef9eb339
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:36 -05:00
Benjamin Walsh
662c3773f8 pipes: remove lingering mentions of 'remote nodes'
Change-Id: I43fe6b0ba77883e2455ecb1ff78bac7d026145c0
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Benjamin Walsh
25d58d6fdb mutex: fix comments still containing the 'node' concept
Also re-indent badly indented code.

Change-Id: Ic08ce5c3b09bc0df9cc404409f871445bbb399fe
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Benjamin Walsh
d41b82a649 latency_measure: fix lingering instance of NODE1
Change-Id: I01917076c8af9cd680baf4be534a87f6eeceb1cc
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Benjamin Walsh
3ade2211de test_timer: remove lingering mentions of 'node' in API names
Change-Id: I9d6e64470e0c7128a620d8af3d0c813a63964860
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Benjamin Walsh
0f5607a211 microkernel: rename _k_init_node() to _k_init_dynamic()
It was badly named: this routine initializes what cannot be done
statically, i.e. what has to be done dynamically.

We also do not have concepts of "node" anymore since the kernel is
single-node only.

Change-Id: Idde3183ca01ca3f70c5ae0e948734a965582ded8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Benjamin Walsh
7bfecd801b fiber: remove fiber from thread list when cancelling delayed start
When THREAD_MONITOR is enabled, not removing the fiber from the thread
list (a) would cause the list to be erroneous, and (b) would cause
corruption of the list if the fiber stack was reused to start a new
fiber (or any other usage really).

Change-Id: I622ffdbd146ec4b0e78b051d1b444fdf35efcd1e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Benjamin Walsh
7b21b2648a nano_context: allow _thread_exit() to be called from a task
Update the documentation of _thread_exit() to reflect the fact that a
task can call it if it does so with interrupts locked. A task or another
fiber cannot preempt a fiber, so a fiber can still call _thread_exit()
without locking interrupts. If a task locks interupts first then calls
it, no fiber or other task can preempt it either.

Change-Id: If8624842fc202a0917b0499458e14f95d7f461df
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Tomasz Bursztyka
7f84234892 ns16550: Use sys_io.h relevant functions depending on context
This will let us getting rid of old outByte/inByte functions.

Change-Id: I3344151c54f99e5e281ac8d3d027e0b810796111
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:36 -05:00
Gerardo A. Aceves
60260536ac Add Recommended Practices Documentation.
Grammar updates.
Corrected formatting to produce cleaner HTML output
Document structure is updated to reflect the current changes
within the entire documentation project.

Change-Id: Icc389ddec16ddfa40ecbbb5871af44563374415c
Signed-off-by: Gerardo A. Aceves <gerardo.aceves@intel.com>
2016-02-05 20:15:36 -05:00
steveballard123
ab315b3046 doc: edited grammar, punctuation, spelling, word usage.
Changes made to streamline using Gerrit recommended practices.
Changes included edits to grammar, punctuation, spelling,
word usage across multiple files.

Signed-off-by: steveballard123 <stephen.r.ballard@intel.com>
Change-Id: I286eb508abe10bb2ca0dd1b070fe7887fd5020e6
2016-02-05 20:15:36 -05:00
steveballard123
670da4331b doc: updating quickstart for style consistency
Rewrote and edited for clarity, punctuation, grammar, word usage.

Signed-off-by: Steve Ballard <stephen.r.ballard@intel.com>
Change-Id: I0332be9152312047a39067e7d610a563352abb1b
2016-02-05 20:15:36 -05:00
Tomasz Bursztyka
a566afbebd ia32_pci: Add support for the designware i2c controller
Only 1 port is available on Quark through the PCI bus.

Change-Id: Ie0e0173686947134d2553dd0fd0230ffa5a1d456
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:36 -05:00
Tomasz Bursztyka
17c8f74859 i2c: Adding support for PCI enabled dw i2c controller
Since such controller is found on Quark x1000 (Galileo, ...), it will
need to get configured and/or enabled through PCI.

Change-Id: I16d00364edcb17653eaaf073e87b4e5850de7299
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:36 -05:00
Dan Kalowsky
7958f22acd i2c: converting to sys-io functions
Using the OS provided sys-io functions for access to the registers
and lower level devices.

Change-Id: I1a88786189cbed0965f84146ffad9988a3b68a7b
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:15:36 -05:00