Commit graph

98463 commits

Author SHA1 Message Date
Andrei Emeltchenko be2135d75e ti_lm3s6965: Add Bluetooth UART definitions for ti_lm3s6965
Add definitions for UART for ti_lm3s6965.

Change-Id: If7b3d6f0cabd69eaad962b5e73429b66d1f0ef0e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:51 -05:00
Dan Kalowsky 20db031fdb Cleaning up mail.h
Several lines wrap beyond the recommended width.  Cleaning up those lines
to be limited in size

Change-Id: Ie4b15087043886d481ce379d225cb9b96816d004
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:51 -05:00
Dan Kalowsky f3ebf6e222 Removing the K_debug_ functions
There is no code that these are attached to any longer.  Removing the
dead externs to K_debug_req and K_debug_ack functions.

Change-Id: I169e6d13ff9d5c89029dea5322cecce62c27e3b1
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:51 -05:00
Dan Kalowsky f600758ba9 Renaming cmdPktGet to _cmd_pkt_get
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I873804e2f2c0b14ab23f6fc2c40e38948e0543c1
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:51 -05:00
Dan Kalowsky fe1226713c Renaming InitPipe to _pipe_init
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I4a3755e77038eccbd31f8247cb230052dd3edccf
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:51 -05:00
Dan Kalowsky 934eca208b Removal of task_node_id_get
With the recent cleanup, the code no longer has the concept of a node, and
therefore no longer needs the following function.

Change-Id: Ib40886c0fc07a465327c95a13106d90f2aef5f0a
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:51 -05:00
Dan Kalowsky 1d31cdce1a Removal of isr_node_id_get
We no longer have the concept of nodes, so this function doesn't
accomplish much of anything.

Change-Id: I273d0a6b746147c96046c13b8d46c17a7d0c2758
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:51 -05:00
Dan Kalowsky 9e8c06563e Renaming GROUP_TASK_ macros to TASK_GROUP_
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.  This specific change maps the macro to the
function naming used by the OS.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: If41030c6b9f0417356807b0cc6f4c287378e0c17
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:51 -05:00
Dan Kalowsky 272064cd19 Renaming K_taskcall to _k_task_call
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ia28f05f27a2e0748bd0499966653c7cc02e04387
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 23eeac2c8d Bluetooth: Process HCI init return parameters synchronously
We only perform the HCI init from a single place, so having generic
command complete handlers is a bit pointless. Furthermore, doing the
commands asynchronously doesn't let us catch all errors that may
occur. This patch converts most of the HCI init sequence to use the
new capabilities of the bt_hci_cmd_send_sync() API to parse the return
parameters synchronously.

Since the command handling automatically converts non-zero statuses to
failures we no-longer need to check for the rp->status values in the
response handlers.

Change-Id: Ibb43312cac596b60ab87d88e37a9ae7ee2588182
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg fbe3a4634d Bluetooth: Add return parameter support to bt_hci_cmd_send_sync()
Instead of having global command completion handler we can keep the
code more concise by letting bt_hci_cmd_send_sync() give back the
return parameters straight to the caller. This patch extends the
buf->hci.sync variable to not just contain the initial semaphore, but
to have the return parameter bt_buf once the semaphore is given back.

The bt_hci_cmd_send_sync() function receives an extra parameter which
may be NULL if the caller isn't interested in the return parameters.

Change-Id: I41e3e4b1189c4a19d0159947a03fd7052cc98fa9
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 89a083f888 Bluetooth: Add reference counting for buffers
In certain scenarios we want to keep the buffers around for longer
and avoid the default bt_buf_put() calls from putting them back to the
available buffers queue. This patch adds reference counting for the
buffers, along with a bt_buf_hold() API to increment the reference
count. Now bt_buf_put() will only put the buffer back to the pool if
the reference count hits 0.

Change-Id: I1590c5574e18600939f55e5339a6da3d061f7682
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko 781c5be2e5 Bluetooth: Enable HCI_CORE debug for samples
This enables debug for HCI_CORE for samples.

Change-Id: Ide0b3c3db0165a5d00439a7bd05fb516bf67a2f5
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko cc90fafaf0 Bluetooth: Add Bluetooth HCI core specific debug support
Configuration option BLUETOOTH_DEBUG_HCI_CORE enables debug support
for Bluetooth HCI core. This allows us to fine tune debug output.

Change-Id: Ibc9a90192b8f3318f9683cef4781d0c3d6ae9f7b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko ea1f5f3785 Bluetooth: Add Bluetooth UART driver specific debug support
Configuration option BLUETOOTH_DEBUG_UART enables debug support for
Bluetooth UART driver.

Change-Id: I192f380be492df1a52ad212239447b6ee4b50aac
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko f269260b8d Bluetooth: Enable debug for Bluetooth samples and tests
Enable CONFIG_BLUETOOTH_DEBUG option for Bluetooth samples.

Change-Id: Id0d0377082b16f78f15c5e968c866bed2df69844
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko 8f539793ef Bluetooth: Add compile test to sanity_check
Add nanokernel init sample to sanity check compile testing.

Change-Id: Ifef4116a6cc7307f7b17a62d066f33b243a2e6ce
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko b3e25209a8 Bluetooth: Add BLUETOOTH_DEBUG configuration option
BLUETOOTH_DEBUG option enables extensive debug output to serial
console. Disabled by default.

Change-Id: I71a6ca4c4f1dfb5bd818e6b8320a07249befadfb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko 97892857e9 Bluetooth: Add nanokernel sample init application
Add nanokernel configuration to build Bluetooth init sample. Later on
sample would added to sanity check builds.

Change-Id: Ib7251c1b3f5d62c4f1e0bb1fba253ebb1e9342df
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg caf5141de5 Bluetooth: Remove unnecessary error checks for bt_uart_read() calls
When the 'len' and 'min' parameters passed to bt_uart_read() are equal
the function is guaranteed to always return 'len' (it will keep
looping until that). This patch removes bt_uart_read() error checks
which would never occur in practice.

Change-Id: Icd879f1e15c6d33acc549155aabd24490098ffc5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 099ecbfa7c Bluetooth: Add minimum required length parameter to bt_uart_read()
There are some places where it's forgivable if bt_uart_read() wasn't
able to read as many bytes as requested. In other places it's not
acceptable (e.g. when reading ACL or event header). To avoid failing
in situations where we can handle receiving less data than requested
this patch adds a new parameter to bt_uart_read() to specify the
minimum required data amount.

Change-Id: I372e3af7aaa6bfabe14896eb10cc71c3deff94f2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 935198e715 Bluetooth: Fix UART driver robustness when out of buffers
If we're out of buffers the UART driver would previously loose sync of
where the packet boundaries go, because it was using the buffer itself
to store and parse the HCI packet headers. This patch modifies the
UART driver to use stack variable for initial header parsing, thereby
being able to always determine how many remaining bytes there are and
cleanly discard the bytes until the beginning of the next packet.

Change-Id: I278f3fc0c983e6a2a6904356ef1af1d25c9f06e4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg d63d0a832d Bluetooth: Make bt_buf_get() wait if necessary & possible
If we are low on buffers we don't necessarily need to have
bt_buf_get() fail if we are in any other scheduling context besides an
ISR. This patch makes the bt_buf_get() function implicitly wait for
more buffers in case none are immediately available. The call to
get_wait() is done as a second step after a non-waiting call so that
we can give a warning log that the stack is running low on available
buffers.

Change-Id: I37430acc337302df23e516c07d38e08b9d61c57c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 50a25dcfd3 Bluetooth: Add BT_WARN convenience logging macro
Some logs indicate potentially problematic situations but are not
necessarily errors. Since we do want to log these regardless of the
debug setting it's better to have a separate BT_WARN macro for them.

Change-Id: Iad13fc4b58329113458c97b02855033836618f5b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 041c84c3e6 Bluetooth: Introduce dummy data type
We're already sending 'dummy' buffers to wake up the connection
fibers. The problem is that if we provide a real buffer type it may
have unintended consequences. E.g. with BT_ACL_OUT when bt_buf_put()
is called it may trigger an invalid HCI_Host_Num_Completed_Packets
command.

This patch creates a new BT_DUMMY buffer type to avoid this scenario.
The new type is an alias for BT_CMD since the pool where these buffers
come from is not quota-controlled and synced up with the controller.

Change-Id: I42ac235811dc242345853f7858c10bfc43e4f07d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 586d76b12a Bluetooth: Add support for reporting completed ACL buffers
Every time we put a BT_ACL_IN buffer back to the pool we should report
this to the controller so it knows it can send us more data. This
patch makes the necessary modifications to the bt_buf_put() function
to trigger the HCI command.

The Host Number of Completed Packets command is special in that it
doesn't need to obey the reported ncmd value and also doesn't generate
any command status/complete events. Because of this we need an
exception for it in the bt_hci_cmd_send() function.

Change-Id: If65f28078fd0d81af853447e95bc53822fea75b7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 39a6c7df9b Bluetooth: Enable controller to host flow control in HCI init
To start supporting controller to host flow control we need to tell
the controller our supported packet count & MTU and send the enabling
HCI command. This patch does the necessary addition to the HCI init
procedure.

Change-Id: I51a66f8cc3a85782a5085f9aae0f4aeb59decad3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 25af03265c Bluetooth: Add ACL user data to bt_buf
To track which ACL handle each buffer belongs to (needed for host flow
control) add the necessary information into a new ACL-specific struct.

Change-Id: Ie6cc7c32a70b43a4ff5954bb9dca34e4f62da292
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 5626788eb7 Bluetooth: Refactor buffer HCI user data
To accommodate for ACL user data move the HCI command/event data into
its own struct and put it inside a union in bt_buf.

Change-Id: I680500b15709d14b1e9f70ced88664d607a6568c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 0c397c6ca2 Bluetooth: Fix potential leak of dev.sent_cmd
In case we for some reason end up in a situation where we'd send
commands while dev.sent_cmd is already set, be sure to clean it away
to avoid potential buffer leaks.

Change-Id: I0aadb84086211e245cb6c1486af885d1dbabfa14
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg d87080392b Bluetooth: Export HCI command sending APIs internally
The APIs to send HCI commands will be needed by more than just
hci_core.c. This patch exports them through hci_core.h.

Change-Id: I7c047f070f25c9f2f8685b46bbce84c4ed459b44
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg c96f8e484c Bluetooth: Fix potential NULL-pointer access in UART driver
If we get an invalid packet type here the buf pointer will be NULL.
Going to the cleanup section at the end of the function would trigger
a bt_but_put() call which would cause a NULL pointer access. Directly
returning from the function is the right thing to do instead.

Change-Id: I0c18646e0820cf829ef8aa3f77835ba0a14375b5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko de1477759c Bluetooth: Add Bluetooth microkernel smoke test
The test registers Bluetooth driver to Bluetooth the subsystem and
runs bt_init() which calls open() callback. We return expected error
to indicate that there is no real Bluetooth device attached.

Change-Id: I39526acbb25e7d4bb322d4511659a40505874592
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko 3760dc8709 Bluetooth: Add Bluetooth nanokernel smoke test
The test registers Bluetooth driver to the Bluetooth subsystem and
runs bt_init() which calls open() callback. We return expected error
to indicate that there is no real Bluetooth device attached.

Change-Id: I1b324c82ce8be2ce73f2b41a07135b0bc76eed61
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg f9725ca3a9 Bluetooth: Remove unnecessary ACL semaphore
Now that we never have more outgoing ACL buffers in circulation than
what the controller is capable of accepting we don't need a separate
semaphore for managing the flow of ACL data to the controller.

Change-Id: I28a14791e8f46ac62b8025956c2865039eae9059
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg cb6b288252 Bluetooth: Rotate outgoing ACL packets via a pending queue
To ensure that we never have more outgoing ACL buffers available than
the controller is willing to accept we should hold on to them between
calling drv->send() and getting the corresponding Number of Completed
Packets event. This patch adds a temporary FIFO in bt_dev for this.

Change-Id: I918119a03081d507de2bb4a731b2709ea99a648d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg b6804df02e Bluetooth: Split buffers into separate pools
In order to do proper flow control of ACL data to/from the controller
we need to have precise management of the available buffers. Mixing
with the events/commands buffers would make this impossible. This
patch splits the buffer pools into three separate ones:

	1. HCI commands/events
	2. Incoming ACL data
	3. Outgoing ACL data

The total number of available buffers is also increased to match
what's the smallest number supported by current controllers (to avoid
the stack from becoming a bottle neck).

Change-Id: I7e131d61c83a4dda554068d7917c5ee09f2f837d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg d829fe9755 Bluetooth: Consolidate bt_buf_get* functions
We may soon want to have a _wait() variant of bt_buf_get, so to avoid
the number of 'get' function growing too large consolidate the
existing get() and get_reserve() functions into a single one. The new
consolidated function also takes the type as input parameter so that
we know this from the very start and thereby plan for the split into
multiple buffer pools.

Change-Id: Ia09448565349def2be9bc08d9510fedd029480b4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 4e65d0aac2 Bluetooth: Split ACL buffers into two distinct types
We'll soon want to have dedicated pools for outgoing and incoming ACL
data. To know from which pool to get and put the buffers each buffer
should contain enough information to distinguish the two types. This
patch splits the old BT_ACL type into two new BT_ACL_IN & BT_ACL_OUT
types.

Change-Id: I7d3c05c26d2a70f80fb1229e245aa21673ec378b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 550cdd9717 Bluetooth: Add dependency includes to hci.h
The hci.h header file depends on the integer type definitions from
stdint.h and the PACK_STRUCT macro from toolchain.h. This patch adds
those so that users of hci.h don't need to be concerned of this
detail.

Change-Id: Ib1856cdec75a3bab1b86bc832cdec6ad0461db6d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:50 -05:00
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