Commit graph

98173 commits

Author SHA1 Message Date
Johan Hedberg 429240d376 Bluetooth: Move buffer handling into a dedicated file
The buffer handling code is quite large and will continue to grow. As
it's not strictly HCI core material it's better to just manage it in a
separate file. This patch moves the code to include/bluetooth/buf.h
and net/bluetooth/buf.c.

Change-Id: Ie1ff79ac2cfa132359ce9f7674ff812d34b228aa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 33c50f332b Bluetooth: Add skeleton for Attribute Protocol handling
This patch adds support for the ATT fixed channel. A dedicated att.c
file is added to handle the ATT protocol handling.

Change-Id: I2e481f56168b6f1b4c564f10d25dee0a85fb968f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg c31237aa82 Bluetooth: Add basic L2CAP support
This patch adds basic L2CAP functions, including support for the LE
signaling channel as well as performing a connection parameter update
in slave (peripheral) role.

Change-Id: Ie1f9751475adcf26576e9587bf6d68d15d6a2569
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg 4831529193 Bluetooth: Add connection abstration
This patch adds a new bt_conn struct which abstracts the details of an
connection. Each connection has two fibers: one for incoming and
another for outgoing data. For now only one connection is supported.
The patch also adds a basic L2CAP header definition so that fragmented
ACL packets can be properly parsed.

Change-Id: Ida38b2657a0e908a18219c3aa2997eb314f2c8a1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg 58c5689531 Bluetooth: Add skeleton for handling disconnect complete events
This patch adds a simple event handler for the LE Disconnection
Complete HCI event. An extra thing the handler needs to do is to
re-enable advertising if necessary, since it will have been implicitly
disabled by the controller upon a connection event.

Change-Id: Ie6f2eecb8c1d7de16fea24c8fd1533545f41baa5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg 64b6f11450 Bluetooth: Move bt_dev definition to internal header file
Several Bluetooth sub-modules will need to have access to the bt_dev
struct definition. This patch moves it to the internal hci_core.h
header file where the sub-modules can access it from.

Change-Id: Ic949c03eb5df86f60a2dac28322d029de10822b5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg 391260d03c Bluetooth: Add skeleton for handling LE conn complete event
This patch adds a basic event handler for the LE Connection Complete
HCI event.

Change-Id: Iea099fe1b8c87fcd00d13e8793ebce8ced7adec6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg 3739760dc2 Bluetooth: Add skeleton for handling LE meta event
All LE related HCI events come wrapped in a LE Meta 'super' event.
This patch adds a basic event handler for it.

Change-Id: I4a037d4af080c3ba0f982586065c0c49b6cf7640
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg f64e3c08b2 Bluetooth: Add semaphore for counting controller-side ACL buffers
We shouldn't be sending more ACL packets to the controller than it
is capable of accepting. This patch adds a semaphore to track the
number of available controller-side ACL buffers.

Change-Id: Ib280afa06aade68eee03e44e33624eebb700dad5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg 5bba29f55a Bluetooth: Add LE peripheral sample app
This patch adds a simple app which initializes Bluetooth and enables
connectable advertising (i.e. starts acting in the LE peripheral
role).

Change-Id: I15bb43ce657b5592d32187a0dfd22ba8bd912641
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg a6fbfe4bc1 Bluetooth: Add simple advertising enabling API
This patch adds a simple API for enabling advertising and specifying
the friendly name in the advertising data. The API is probably not a
final one but fulfills the initial need to create apps that are able
to act in the LE peripheral role.

Change-Id: I3ff7e72ece377d872ef1b0e4ad44aeb293cc13e5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg 7bfbe7abf2 Bluetooth: Add basic advertising definitions
To manage LE advertising we need basic HCI definitions for the
commands and events involved. This patch adds those to the hci.h
header file.

Change-Id: Ic6cf17369ad09d97ca5c098f25ba786d265d0bfd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Allan Stephens ed7a3d2724 Update minimum nanokernel footprint benchmark
Revises the nanokernel footprint benchmark project so that the
minimum x86 configuration explicitly excludes support for the
system timer. (This doesn't actually save any memory, since timer
support was already being excluded; however, the project now makes
this lack more apparent, and does it the same way as the minimum
microkernel benchmark project does it.)

Change-Id: I509994bb640fee3208e4c1397a79cd134172370a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens 9b400e6f89 Update minimum microkernel footprint benchmark
Revises the microkernel footprint benchmark project so that the
minimum x86 configuration excludes support for the system timer.
The resulting "tickless kernel" image is about 1200 bytes smaller
(about 15%).

Change-Id: Ie7be8427963818c7d0d75173d3da844722487f0b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens ec7b9fba4a Allow system generator to support tickless kernel
Revises sysgen so that it doesn't generate timer-related variables
or executable code for a tickless microkernel. Also corrects some
misleading comments about dependencies on timers.

Change-Id: I5655e32fcab22d9991f2f8e0f2db9557642b6b54
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens 8aa14ab4dc Allow microkernel timer code to support tickless kernel
- Needs the same change as for nanokernel timer code to prevent
a divide by zero error.

- Eliminates a prototype version of task_sleep() that attempted
to delay by busy waiting; this won't work because the kernel
won't have any timer support in place at all!

- Removes some unnecessary #ifdefs.

Change-Id: I0debf7aed4e4075f5821a77014c3a1d65fefe923
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens 9df8af92d6 Allow nanokernel timer code to support tickless kernel
Only required a minor tweak to avoid a divide by zero error.

Change-Id: Id2cc680ba621f0a3df9660606e9bbfa81c6fbe46
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens f64b8a0784 Allow memory pools to support tickless kernel
Revises microkernel memory pool code so that it properly handles the
case where the kernel does not have timer support.

Change-Id: I38fc3916681bbd3ac678399724ddb679a16f6ead
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens 8065d38da7 Allow memory maps to support tickless kernel
Revises microkernel memory map object code so that it properly
handles the case where the kernel does not have timer support.

Change-Id: I2dfb0663c91370ffbaed94d1d6aea909f64398db
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens 0fef5cc2ac Allow mailboxes to support tickless kernel
Revises microkernel mailbox code so that it properly handles the
case where the kernel does not have timer support.

Change-Id: Ibd3ff657e0cad1320d037d7c1e3e3c673c56c9e9
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens f67864c249 Allow FIFOs to support tickless kernel
Revises microkernel FIFO code so that is properly handles the
case where the kernel does not have timer support.

Change-Id: If069cafbcf695c48c2d788ea2a6b6e04a9f0c878
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens b31f1d2b5e Allow semaphores to support tickless kernel
Revises microkernel semaphore (and semaphore group) code so that
it properly handles the case where the kernel does not have timer
support.

Note: Semaphore code has some commands and routines whose names
imply that they are used only in cases where a timeout occurs,
even though they can be used in non-timeout scenarios too!

Change-Id: I6747032dd215f9b98e9d7d971e4b3ff32fbd7e55
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens e0bf49224c Allow mutexes to support tickless kernel
Revises microkernel mutex code so that it properly handles the
case where the kernel does not have timer support.

Change-Id: I987780521e137b95b9544013793937cdf45abafb
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens 1965fe0990 Allow task IRQ code to support tickless kernel
Revises microkernel task IRQ code so that it properly handles the
case where the kernel does not have timer support.

Change-Id: Idc9bd120151e5c18798e1ed98af30dabe245fe64
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens c6e467e3dd Allow events to support tickless kernel
Revises microkernel event code so that it properly handles the
case where the kernel does not have timer support.

Change-Id: I72b0cef0e6a8cd19206857ec6c7564edf94edb72
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens 07646ce038 Revise dependencies for timer-related configuration options
Revises the relationships between several configuration options
to support a tickless kernel capabilty. Specifically:

1) SYS_CLOCK_TICKS_PER_SEC is now always defined, so that it can
be referenced by TICKLESS_KERNEL. However, SYS_CLOCK_TICKS_PER_SEC
is forced to 0 when there is no timer interrupt support.

2) NUM_TIMER_PACKETS is now forced to 0 in a microkernel system
when TICKLESS_KERNEL is enabled.

3) TIMESLICING is now disabled when TICKLESS_KERNEL is enabled.

Change-Id: Ie8bf58e7828069afe68ae9451ffbf9bc220ea35f
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Dan Kalowsky 270f8d8768 Renaming k_timer.Tr to k_timer.period
Updating the micro kernel structures and variable names to create a
more meaningful context by their name.

Change-Id: Ib3ae2cd9055f0690d454a0f52488721541c0fb62
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:49 -05:00
Dan Kalowsky cc4180074d Renaming k_timer.Ti to k_timer.duration
Updating the micro kernel structures and variable names to create a
more meaningful context by their name.

Change-Id: Ie7b14787d36d99ed131db6ac3d4fbb652dc39b57
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:49 -05:00
Tomasz Bursztyka 03d4fc2e2f byteorder: Add macros for 32bits values
As for 16 bits integers, let's add utility byteordering macros for 32
bits integers.

Change-Id: I3113b9890992e4335d300a17738e5bb772b719ae
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:13:49 -05:00
Allan Stephens f6699ae741 Convert LITE references to TICKLESS_KERNEL references
Converts all remaining references to the obsolete LITE symbol by
changing them to CONFIG_TICKLESS_KERNEL.

Note that the tickless kernel capability remains experimental,
as more work is required to properly support it.

Change-Id: Ie0d2514d00c3fd86297f38499e79f4d9c9edc15c
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens 9a8b13974e Define TICKLESS_KERNEL configuration option
Introduces the TICKLESS_KERNEL configuration option, which indicates
that the kernel does not support timing capabilities. This option is
enabled automatically if the system tick rate is set to zero ticks
per second.

Change-Id: I20e6eb23465baf5f79055c7ff8979537b85dcc06
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens bb9e641da0 Remove VXLITE references from build system
Not related to the LITE support in the kernel, that VXLITE
variable was provisioned for a potential other name for
VxMicro, and was never used.

Change-Id: I23ce1fda1064141ab7e7e75fa2b2a12b9361d624
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens 1cb6e5fbb5 Remove LITE-related dependency for app_kernel benchmark
Benchmark code that depends on the state of LITE-related symbols
has this dependency removed, and is now coded as if these symbols
are not defined. This change has no operational impact, as LITE-
related symbols were never defined.

Change-Id: I9b9a108223903b8e4dd675a599ca5b8e5cbe7fc7
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens 3a7c6f32fc Remove most references to LITE symbol
Most kernel code that depends on the state of the LITE symbol
has this dependency removed, since the symbol was used for an
incomplete feature that could not be enabled. This change has
no operational impact, as the LITE symbol was never defined
by the build system.

In a handful of timer-related references to LITE are not removed,
as they will be useful in adding a tickless kernel capability.

Change-Id: I4ae37f484e3ab08093b732d45aca87d2e8678adf
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Peter Mitsis bf2e1d3017 Remove remaining references to NLI
NLI files are not supported.

Change-Id: Id9bb1b083051e8ed65b854b4293f2848a46b1589
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:48 -05:00
Peter Mitsis a8264180d8 Remove NLI related kconfig options from BSPs
The NLI related kconfig options are no longer required.

Change-Id: Icc6557ff87969119aaa2d74c51cfd57130e7a0df
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:48 -05:00
Peter Mitsis 07384d63d8 build: Do not generate the nli/config1p.nli file
NLI files are not needed anymore since a) the new sysgen does not make
use of them and b) what NLI files were providing is now kconfig-driven.

Change-Id: I8520b6214a7d47e5bc41e9a108d4786c8f2f6f04
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:48 -05:00
Peter Mitsis ce387b738e build: remove leftover commands for invoking host server
iWINECONSOLE and iWINEHOSTSERVER were used to point to the Wine commands
used to start the host server and the host server console: both Wine and
host server are now irrelevant.

Change-Id: Ia8e3e240553fcde11d0b6e46cfee51913a6f5d1a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:48 -05:00
Peter Mitsis 2010da4176 build: Remove SECTION_GARBAGE_COLLECTION kconfig option
The SECTION_GARBAGE_COLLECTION kconfig option is no longer used.

Change-Id: Ie45694b4fbe9e6b5491ffd9eb102c4a5e9717e69
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:48 -05:00
Peter Mitsis c2929b4f38 toolchain/arch: Remove section garbage collection ifdef guards
Section garbage collection is to be always enabled.

Note that this does not have any impact on performance measurements of any
existing sample project as they all use the default section garbage collection
value (enabled).

Change-Id: I57baa55dd52d45b633d8ca319e799ef483a5246b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:48 -05:00
Peter Mitsis 743ff6a74e build: Always enable section garbage collection flags
Enables the section garbage collection compiler flags regardless of the
state of the SECTION_GARBAGE_COLLECTION kconfig option.

Change-Id: Iad488b3ca4ee0a80898f83809e4c615efcdbd03f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:48 -05:00
Peter Mitsis 9dec8d068c samples: remove SECTION_GARBAGE_COLLECTION
By default, the kconfig option SECTION_GARBAGE_COLLECTION is already enabled.
Removing this option from the project configuration files does not change the
resulting images.

Change-Id: I0f3329aa15a341c2c1082f75162b2b3e12447a26
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:48 -05:00
Allan Stephens c8c5ae8f7f Reduce default number of task priorities to 16
Lowers the default value for the NUM_TASK_PRIORITIES configuration
option to 16, as typical system are unlikely to need 64 different
task priorities.

Change-Id: I6d7baa5671628815ab1953dcb0b8266f28df3014
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:48 -05:00
Allan Stephens c6fbf4d8fc Configure number of task priorities for sample projects
Explicitly configures the number of task priorities for sample
projects that require more than 16 priorities. (This ensures
that the projects continue to work properly when the default
value of NUM_TASK_PRIORITIES is reduced to 16 in an upcoming
commit.)

Change-Id: I03b9ae68a6b782c62c8799f44d17e659e7d6074e
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:48 -05:00
Allan Stephens 6f75c5a9c2 Configure task priority queues in microkernel footprint benchmark
Revises the microkernel footprint benchmark sample projects to take
advantage of the NUM_TASK_PRIORITIES configuration option. Most
notably, this reduces the size of the minimum microkernel configuration
by over 500 bytes.

Change-Id: I2be1b0a5a09800559df4d1bf355de38d6c0b9ab3
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:48 -05:00
Allan Stephens 1c32b5d720 Introduce NUM_TASK_PRIORITIES configuration option
Allows the number of task priority levels supported by the micro-
kernel to be configured, rather than fixing this value at 64.
Setting NUM_TASK_PRIORITIES to N provides support for task
priorities 0 (highest priority) through N-1 (lowest priority).
The lowest priority is reserved for the kernel's idle task.

This enhancement allows system designers to significantly reduce
the size of the microkernel's task priority queues by eliminating
unneeded queues. In systems requiring only a few task priorities
over 500 bytes can be saved.

Change-Id: I497aac608a3d548fb1b024068c08a5f494c3d524
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:48 -05:00
Allan Stephens 09ef176ce0 sysgen: Fix PEP8 standards violations
Corrects issues introduced by recent global variable renaming that
resulted in lines exceeding PEP8 guidelines. (Running the command
"pep8 scripts/sysgen.py" once again reports no issues.)

Change-Id: I6dff820bc3529cbffbc930c13e98171140c09a52
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:48 -05:00
Tomasz Bursztyka e2eff8fafc quark: Avoid duplicate definition
No need to duplicate PCI class definition since it's alread defined in
drivers/pci/pci_mgr.h.

Change-Id: I834b99c300487d7c51e406555de87d2484222213
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:13:48 -05:00
Tomasz Bursztyka 40b1080150 pci: Put the public API header in the right location
Instead of drivers/pci/, the public API headers will be found in
include/drivers/pci.

Change-Id: I577036660383e6bd9c015d6bbbcbc14bf8fb67ec
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:13:48 -05:00
Tomasz Bursztyka ae09a48a7e console: Put the public API header in the right location
Only moving the header from drivers/console/uart_console.h to
include/drivers/console/uart_console.h so source file did not need to be
changed, only the defs.objs files to look into include/drivers/console.

Change-Id: I585e16b50d9ffecf01ca9225e80f0e101f62ee4c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:13:48 -05:00