Commit graph

42249 commits

Author SHA1 Message Date
Mariusz Skamra
51e4fd4b8d Bluetooth: Rename device_found function
check_pending_conn gives more information about what this function
is actually doing.

Change-Id: Id21580e03bb1c341c7cf3671a666e385738fb3d4
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:39 -05:00
Arkadiusz Lichwa
9bf8ad20df Bluetooth: ATT: Check ATT payload len against MTU
During allocation ATT pdu buffer there's possibility to precheck
whether length of such buffer doesn't exceeds ATT MTU.

Change-Id: I7f729e4d7f7474d7f33e417ea61a00ceeb7426c5
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:14:39 -05:00
Mariusz Skamra
66cf2511f1 Bluetooth: SMP: Add BT_KEYS_SLAVE_LTK key in bt_smp_distribute_keys
Without this patch, we send LTK Request Negative Reply after reconnection.
It fails in le_ltk_request:

	if (conn->keys && (conn->keys->keys & BT_KEYS_SLAVE_LTK) &&
	    conn->keys->slave_ltk.rand == evt->rand &&
	    conn->keys->slave_ltk.ediv == evt->ediv) {
		bt_hci_cmd_send(BT_HCI_OP_LE_LTK_REQ_REPLY, buf);
	} else {
		bt_hci_cmd_send(BT_HCI_OP_LE_LTK_REQ_NEG_REPLY, buf);
	}

Change-Id: I9b926b7ba01743dcfa79f51650271f6e12cc2ff8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:39 -05:00
Mariusz Skamra
81895bd738 Bluetooth: shell: Extend shell app functionality to turn off adverising
Change-Id: I5beb5abac3ecc982a154fd062eb34b1d5ee170e9
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:39 -05:00
Mariusz Skamra
f45bbec4a1 Bluetooth: hci: Add bt_stop_advertising
This adds above function to stop ongoing advertising.

Change-Id: I16b3913524a61e844a81cbe733f2b8e6072ab442
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:39 -05:00
Johan Hedberg
d0950676e8 Bluetooth: Add bt_keys_add_type() convenience API
When we already have bt_keys object and want to ensure that it
contains a certain key type it's wasteful to have to go and call
bt_keys_get_type() (because of the extra lookup it'll do).

Change-Id: I97831e6817e734d7e8b6aa18c7917736577f3438
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:39 -05:00
Luiz Augusto von Dentz
001d29218a Bluetooth: ATT: Handle Find Info response
This adds function handler for Find Info Response PDU which call the
request callback:

< ACL Data TX: Handle 3585 flags 0x00 dlen 9
      ATT: Find Information Request (0x04) len 4
        Handle range: 0x0010-0x0011
> ACL Data RX: Handle 3585 flags 0x02 dlen 14
      ATT: Find Information Response (0x05) len 9
        Format: UUID-16 (0x01)
        Handle: 0x0010
        UUID: Characteristic (0x2803)
        Handle: 0x0011
        UUID: Heart Rate Control Point (0x2a39)

Change-Id: I981e9efe75f6eb032d9468549272c82720cb133d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:39 -05:00
Mariusz Skamra
fcda155262 Bluetooth: SMP: Fix invalid return from smp_pairing_master
With this patch, Identity Information and Identity Address
Information are properly received. There was a bug when
returning too early from smp_pairing_master function
and not setting BT_SMP_CMD_IDENT_INFO bit in allowed_cmds.

bt: bt_smp_recv (0x0010f054): Received SMP code 0x06 len 17
bt: smp_pairing_encrypt (0x0010f054):
bt: bt_smp_recv (0x0010f054): Received SMP code 0x07 len 11
bt: smp_pairing_master (0x0010f054):
bt: bt_smp_recv (0x0010f054): Received SMP code 0x08 len 17
bt: bt_smp_recv: Unexpected SMP code 0x08
bt: bt_smp_recv (0x0010f054): Received SMP code 0x09 len 8
bt: bt_smp_recv: Unexpected SMP code 0x09

The return should be after distributing LTK, EDIV and Rand if
IdKey was not set.

bt: bt_smp_recv (0x0010effc): Received SMP code 0x06 len 17
bt: smp_pairing_encrypt (0x0010effc):
bt: bt_smp_recv (0x0010effc): Received SMP code 0x07 len 11
bt: smp_pairing_master (0x0010effc):
bt: bt_smp_recv (0x0010effc): Received SMP code 0x08 len 17
bt: smp_ident_info (0x0010effc):
bt: bt_smp_recv (0x0010effc): Received SMP code 0x09 len 8
bt: smp_ident_addr_info (0x0010effc):
bt: smp_ident_addr_info (0x0010effc): identity 88:63:DF:88:0E:83 (public)
bt: bt_smp_disconnected (0x0010effc): conn 0x0010badc handle 64

Change-Id: Ic98cf6fd6ad2f7e41c6cd506d39fc9a9571a491f
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:39 -05:00
Johan Hedberg
410a8a8165 Bluetooth: Fix doxygen documentation for bt_connect_le()
Change-Id: Ib40d5a23ee60dad16686f43dee172a31c456e7e1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:39 -05:00
Johan Hedberg
47cb69458a Bluetooth: Remove unnecessary 'err' variable from bt_connect_le()
Instead of caring about stop_scanning() failure it's better to have
bt_connect_le() do "best effort" and simply try to continue in this
case.

Change-Id: I14896a4dfbe0bfd2564a190080743f0c9b05d174
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:39 -05:00
Johan Hedberg
7d8e97c9a1 Bluetooth: Fix potential bt_conn leaks
There's no need to check for BT_CONN_CONNECTED for these HCI events or
ACL data. Even if the connection is being disconnected the stack will
do the right thing when the disconnect_complete event occurs.
Furthermore, these branches were actually leaking the bt_conn if the
state wasn't connected after being looked up.

Change-Id: I2e22d67cb43a86e742663a896e853de02fe9e325
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:39 -05:00
Johan Hedberg
636415212a Bluetooth: Fix various coding style issues
Change-Id: Iffcc0db1dca5eba16ce10039d918175e72ac8f2f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:39 -05:00
Johan Hedberg
5ed9cb7b5b Bluetooth: Clean up bt_conn reference counting
Make the reference counting of bt_conn clearer by having the reference
taken by the first state transition and released by the last state
transition handled in the bt_conn_set_state() function.

Change-Id: Iee04758fcc7f770e6ccfd351f33be60e7d646f19
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:39 -05:00
Johan Hedberg
1732e81c58 Bluetooth: SMP: Rename PDU handlers for consistency
Change-Id: Ifb7489b0c0631c0ce4285da97ef09bc2db3200f9
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:39 -05:00
Rodrigo Caballero
f184a89610 Doxygen: Remove duplicate comment.
Removes a duplicated comment on the FIFO documentation.

Change-Id: Iff81fd0df67e23517c199c866542db28d12cc42a
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
b4e1f7154a sanity: Replace obsolete BSP_FLAG with PLATFORM_FLAG
The bluetooth regression script now refers to PLATFORM_FLAG instead of the
obsolete BSP_FLAG variable.

Change-Id: I8cafc01b66004c7bdd76c03d3f3b6aeba134565d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
e6b8bc6477 Remove obsolete kernel references to BSP
BSP terminology is obsolete.

Change-Id: Ic23688fbaaf88e037e184c8bbfc7aaa0ba997b31
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
e2e68d3b9f Update comments in ctors.c
Updates the comments in ctors.c to more accurately reflect the current
state of constructors.

Change-Id: I8bea13ac9b56b4d7c6ce793f175666506fffa446
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
da299ecd47 Update nanokernel boot_time project
Removes references to old platform names.

Change-Id: I65baa148006fbda916904914844b1b347f8ec654
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
310c63e386 Update microkernel boot_time project
Removes references to old platform names.

Change-Id: I53e9994c794c6b4c292e776355a67b7923c2fdb8
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
2871ca32d3 Rename x86 platforms
Changes the the names of the x86 platforms so that they are more generic.
  generic_pc -> ia32
  quark -> ia32_pci

NOTE: it is expected that the two platforms will eventually be merged into one.
one. At present, the two platforms support different hardware.  For example,
the ia32 supports bluetooth whereas the ia32_pci does not, and the ia32_pci
supports both PCI and HPET whereas the ia32 does not.

Change-Id: I8a980aaef55be8c59f7d19ddeb7fafbf11253408
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
213db12fbf Move platforms to new arch/<arch>/platforms directory
Change-Id: I9ad5d51329d381c091aa47b482a8e38e7c194118
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
3019daba6a Cosmetic: Fix issues found by checkpatch
Change-Id: I6beb9ca93a98784d456740d76737996b50a65a71
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
7e28edbc96 Generalize interrupt_controller include path
Improves code consistency by abstracting the architecture directory in the
set of assembly include paths.

Change-Id: I4b3638419a1242cb0628f128c5e3b82c3357d83c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Tomasz Bursztyka
be587bae56 spi: Fix the generic API header
- Lack of some includes
- And bogus function signature

Change-Id: I4d504de83efeaa223c99da3e6fbe69b6e85823ee
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:14:39 -05:00
Rodrigo Caballero
8fd2fd8de4 DOC: Restructures the documentation in two parts.
The contents are split in two: Zephyr Kernel and Zephyr Project. Under
Zephyr Kernel is all the content directly about the code base. Under
Zephyr Project is all the content about the development of the kernel
and of applications. Only the Doxygen document needed to be split. The
output of the in-code comments was placed under the Zephyr Kernel while
all the Doxygen guidelines and the extraction process information were
placed under the Zephyr Project.

Change-Id: I4f7b674d19449968e976b63f40bcaa9737cc0ecb
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:14:39 -05:00
Javier B Perez Hernandez
65c225dae8 Doxygen: microkernel: Move event documentation from c to .h file
Move the comments from k_event.c file to event.h. Only external API information was moved.
Minor changes to adapt comments and parameters.

Change-Id: I05124fc48720105a246826c94f3f21a6e30d6043
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
2016-02-05 20:14:39 -05:00
Anas Nashif
212146d5b4 doxygen: fix comments in printk.c
Change-Id: Ia76b2ef1798999057d8b3a8f1e100e930702d179
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
9d63adf3ea Renames supported platform configurations
Renames supported platform configurations to conform to new platform
configuration naming scheme.

Example usage with PLATFORM_CONFIG:
    make PLATFORM_CONFIG=basic_cortex_m3
    make PLATFORM_CONFIG=basic_atom
    make PLATFORM_CONFIG=basic_minuteia
    make PLATFORM_CONFIG=galileo

  xxx_ti_lm3s6965_defconfig           -> xxx_basic_cortex_m3_defconfig
  xxx_generic_pc_atom_n28xx_defconfig -> xxx_basic_atom_defconfig
  xxx_generic_pc_minuteia_defconfig   -> xxx_basic_minuteia_defconfig
  xxx_quark_defconfig                 -> xxx_galileo_defconfig

Change-Id: I696eb8b9ad9a72d7a72efbe1341ce23500335764
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Juan Manuel Cruz
ba56372083 Doxygen: Microkernel semaphore APIs comments to header files.
This commit moves the comments from the k_semaphore.c file to the
semaphore.h and kernel_main.h files.

Change-Id: Ica86945e738f1f61b8ed216981bce55351029645
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:38 -05:00
Carol Lee
20fdf29cb9 doc: Doc changes made to reflects new ISR code.
ISR documentation changed to incorporate new ISR functionality.

Change-Id: I35a95dab9f4fd407ff297f55faa1e3ebbefc8064
Signed-off-by: Carol Lee <carol.lee@windriver.com>
2016-02-05 20:14:38 -05:00
Allan Stephens
0bd2bafb57 doc: Eliminate unneeded preamble to mutex documentation
This text was originally used to illustrate the layout that would
be used for all microkernel object documentation, but it's no
longer needed since enough files have been converted to make
the approach self-evident.

Change-Id: I2646f7e7c0e541dd5930c13b2319aa85205a8111
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:38 -05:00
Anas Nashif
3d07b2d1ba doxygen: base_api.h comments cleanup
Change-Id: Id9197853064afa082d4c4aa50f2a3ca47f96694b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:38 -05:00
Anas Nashif
629dfc26c9 doxygen: Cleanup arch.h comments
Change-Id: I0c5743ab2db3cb1bc584ced4fa9d91c84da971b8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:38 -05:00
Anas Nashif
9aeb08213f toolchain: add support for iamcu toolchain
See
https://groups.google.com/forum/#!topic/ia32-abi/cn7TM6J_TIg

for more details.

• Support IA32 without FPU.
• Minimum ISA: Pentium ISA without x87 FPU instructions.
• Don't allow mixing i386 object files with Intel MCU object files.
• Support floating point with software emulation:
     a. Long double is the same as double.
     b. Use __float80 for 80-bit double.
• Minimize memory footprint:
     a. Code size
     b. Data size
     c. Stack size

Here is the draft of Intel MCU psABI.   The differences from IA32
 psABI are

1. The minimum instruction set is Intel Pentium ISA minus instructions
for x87 floating point unit.
2. There are no x87 floating point registers.
3. There are no vector registers.
4. Segment registers are optional.
5. Support for TLS relocations are optional.
6. Scalar types larger than 4 bytes are aligned to 4 bytes.
7. There are no vector types.
8. _Decimal32, _Decimal64, and _Decimal128 types are optional.
9. long double type is the same as double.
10. float, double and long double types are passed and returned in
 general purpose registers.
11. _Decimal32 and _Decimal64 types are passed in general purpose
registers.
12. Aggregate types no larger than 8 bytes are passed and returned
in general purpose registers.
13. Stack is 4-byte aligned.
14. The auxiliary vector support is optional.
15. Register %edx has undefined value at process entry.
16. New ELF machine code: EM_IAMCU.
17. New predefined C/C++ pre-processor symbols: __iamcu and __iamcu__

Change-Id: I6a0c45ad22d8f710b6f37a041aaa2fc1bf0b1c39
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:38 -05:00
Anas Nashif
c2762f5b5b Remove unused BOOTLOADER_GRUB
This option was remove as part of linker script cleanup
a few months ago.

Change-Id: If04d69096eb3ef682d72258be90bf710ed931e69
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:38 -05:00
Anas Nashif
0e34c459db kconfig: Update defconfig files with new options
Change-Id: I393dfa270a7e6cd23171c66e298ffc46418a4a67
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:38 -05:00
Andrew Boie
84fed36539 Kbuild: Introduce QEMU_PIPE option
If set, 'make qemu' will direct its console output to a named pipe and
disable the interactive monitor. Intended for use with the new sanity
check system which will parallelize test execution.

Change-Id: I902f77c02ed3f210891ff13147afea890e64d9c1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:38 -05:00
Andrew Boie
c69920798b Makefile.inc: fix indentation
An additional level of indent after line continuations makes this file
easier to read.

Change-Id: I2f5de9b811a5e725639d3a0c2cd62196c2a9e9c4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:38 -05:00
Rodrigo Caballero
aec402b498 DOC: Fix broken tables of the microkernel object documentation.
Fixes the tables of the APIs so that they are displayed properly on the
HTML output.

Change-Id: I616def73e84d5b0ec51e5bc3fa0ce3673e9af344
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
519351ee92 Use PLATFORM_CONFIG to specify configuration
Uses PLATFORM_CONFIG to specify the configuration file instead of
KBUILD_DEFCONFIG.  This name is more intuitive to Zephyr users and
it is not tied to kbuild.

Example usage:
    make PLATFORM_CONFIG=generic_pc_atom_n28xx
    make PLATFORM_CONFIG=generic_pc_minuteia
    make PLATFORM_CONFIG=quark
    make PLATFORM_CONFIG=ti_lm3s6965
    make PLATFORM_CONFIG=fsl_frdm_k64f

Change-Id: I177608942c3e77c2f152743c862aad1d460c0e33
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
c141aaae37 arch/x86: Remove pentium4 Kconfig options
Removes CONFIG_CPU_PENTIUM4 and CONFIG_PLATFORM_PENTIUM4 as Zephyr does not
support the Pentium4.

Change-Id: Ieb1970894eda184f4c33d03e3563fb08f861ec6c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
42f8ae553f arch/x86: Remove unsupported platform configuration files
Removes the generic_pc and generic_pc_pentium4 platform configuration files
as Zephyr will not support them.

Change-Id: Iffa917d8e31702e6280eca3cbc9cdaf3f8ed9c98
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
9690835e32 sample projects: Remove generic_pc and pentium4 support
The generic_pc and generic_pc_pentium4 platform configurations are not
essential configurations to Zephyr.

Change-Id: Idd384bc7f180c035b1467e8b56fbfe206604658f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
3b33a3b437 sample projects: change default KBUILD_DEFCONFIG
Changes default KBUILD_DEFCONFIG to xxx_generic_pc_atom_n28xx_defconfig as
the xxx_generic_pc_defconfig configuration will not be supported in the future.
Note that like generic_pc, atom_n28xx runs on QEMU.

Change-Id: I49c5708e4b24dbf723eefc1efddfea4174d9cb1c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
e147071219 sanity: out-of-tree_chk: minuteia -> atom_n28xx
Replaces the default executable target (generic_pc_minuteia) with
generic_pc_atom_n28xx.  This ensures that sanity testing can evaluate
two different x86 processors just as it did before generic_pc_pentium4
was removed.

Change-Id: Iad439d8465811e9e45f02e9516ce3e6d65d7c1ed
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
4f1cc4e168 sanity: Mark atom_n28xx as an executable target
Marks the generic_pc_atom_28xx platform configuration as a default executable
target.  This is desirable as the removal of generic_pc_pentium4 removed an
executable target from the sanity test suite.

Change-Id: Ic990a003ff23367199164dfcc434c033d78abaac
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
7b363ebe70 sanity: Remove generic_pc_pentium4
Removes the generic_pc_pentium4 platform configuration from the sanity tests
as the pentium4 is not considered an essential target for Zephyr.

Change-Id: I804ad44c4157f40a501ae56b928b57b2003d2415
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
5890d1fbb4 kbuild: remove BSP+variant to defconfig mapping
Removes the BSP+BSP_VARIANT to KBUILD_DEFCONFIG mapping.  Consquently,
KBUILD_DEFCONFIG must be defined (via Makefile, or command line, or environment
variable, ...) when building any project.

Change-Id: I0a416977bc0d37419c4a6bcf40560b3b32f19f8d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
47808955ac Network sample projects no longer use BSP
Network sample projects no use KBUILD_DEFCONFIG instead of BSP.  This
is a necessary step in transitioning from BSPs to platforms.

Change-Id: Ia1ebb697d9e68974f71faa467f1f946f0d1afbd1
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00