OSDN Git Service

android-x86/system-bt.git
9 years agoLogging cleanup
Chris Manton [Wed, 24 Sep 2014 22:18:41 +0000 (15:18 -0700)]
Logging cleanup

9 years agoRemove unused definitions from bt_target.h
Chris Manton [Wed, 24 Sep 2014 17:27:52 +0000 (10:27 -0700)]
Remove unused definitions from bt_target.h

9 years agoEliminate memory leaks and unsafe callbacks in BTA and BTE.
Sharvil Nanavati [Mon, 22 Sep 2014 06:50:54 +0000 (23:50 -0700)]
Eliminate memory leaks and unsafe callbacks in BTA and BTE.

Alarms were being added to a hash map but were not freed during
teardown. This results in both memory leaks and potential access
of torn-down data (in case the still-armed alarm fires after
teardown completes).

9 years agoAdd string hashing function using djb2
Chris Manton [Fri, 19 Sep 2014 16:08:32 +0000 (09:08 -0700)]
Add string hashing function using djb2

9 years agoDisassociate hash algorithm with hash function name
Zach Johnson [Mon, 8 Sep 2014 18:39:49 +0000 (11:39 -0700)]
Disassociate hash algorithm with hash function name

This will make it easier to select the correct one for the job, and also
make it possible to substitute a better one in the future if need be without
having to change the function name.

kunth is duplicated, once for integer hashing and once for shallow pointer hashing, to
make usage more readable.

9 years agoRewerite btif_sendmsg in terms of thread_post
Zach Johnson [Tue, 23 Sep 2014 00:59:02 +0000 (17:59 -0700)]
Rewerite btif_sendmsg in terms of thread_post

9 years agoFix alarm setting for newer deadlines
Zach Johnson [Tue, 24 Feb 2015 07:43:03 +0000 (23:43 -0800)]
Fix alarm setting for newer deadlines

If an alarm is being set and is the newest deadline
among a set of existing alarms, it would be appended
after the first existing alarm rather than prepended
in front.

This in turn meant the root alarm wasn't getting
rescheduled correctly, especially if the old
deadline was rather distant in the future.

(This was causing the bluetooth disable sequence to
fail intermittently.)

9 years agoPost adapter_state_changed events to the JNI workqueue
Zach Johnson [Thu, 25 Sep 2014 18:58:50 +0000 (11:58 -0700)]
Post adapter_state_changed events to the JNI workqueue

Otherwise, JNI rejects the callbacks. Fix for b/17655336

9 years agoDon't send adapter change until stack manager updates state
Zach Johnson [Wed, 24 Sep 2014 23:01:29 +0000 (16:01 -0700)]
Don't send adapter change until stack manager updates state

Since the callback occurred before the stack manager updated its
state to say the stack was fully loaded, there was a chance that
the adapter name change would be attempted before the state was
updated.

This would cause the adapter property change function to return
a "not ready" status.

9 years agoEliminate memory leak in stack initialization.
Sharvil Nanavati [Mon, 22 Sep 2014 06:49:23 +0000 (23:49 -0700)]
Eliminate memory leak in stack initialization.

A heap allocated semaphore was not freed after use.

9 years agoFix bug where some BTU timer callbacks weren't propagated in a timely manner.
Sharvil Nanavati [Thu, 18 Sep 2014 08:54:06 +0000 (01:54 -0700)]
Fix bug where some BTU timer callbacks weren't propagated in a timely manner.

This change sends an event to the BTU task after enqueuing a timer
callback into its timer queue so that the BTU task thread wakes up
and dispatches the callback ASAP. Otherwise, the callback will be
dispatched at a random time or sometimes not at all.

All bdtest cases pass after this change.

9 years agoFix timeout values for BTA system timers.
Sharvil Nanavati [Thu, 18 Sep 2014 07:55:11 +0000 (00:55 -0700)]
Fix timeout values for BTA system timers.

bta_sys_start_timer assumes a timeout value in GKI ticks but the
callers are passing in a timeout value in milliseconds. This change
updates the implementation to use units of milliseconds.

9 years agoAdd back timer list entry in_use field
Chris Manton [Wed, 17 Sep 2014 20:30:13 +0000 (13:30 -0700)]
Add back timer list entry in_use field

I thought this field was used for internal
bookkeeping, but it turns the higher layer
protocols use it to condition if a timer
should be started or stopped.

9 years agoEnable assertions.
Sharvil Nanavati [Fri, 1 Aug 2014 23:40:56 +0000 (16:40 -0700)]
Enable assertions.

9 years agoRemove btif enable state management
Zach Johnson [Fri, 19 Sep 2014 01:46:39 +0000 (18:46 -0700)]
Remove btif enable state management

It's no longer necessary with the stack manager.

With these changes I don't think we'll be able to handle clean_up
as a result of an enable timeout coming down from Java.
But I think I'm ok with that.

At that point we're already hosed because of something else
which should be fixed. And if we wanted to handle clean_up during
start_up we'd violate the mutually exclusive guarantees the stack
management thread makes about init/start_up/shut_down/clean_up.

9 years agoMake stack manager functions not finish until action complete
Zach Johnson [Fri, 19 Sep 2014 01:13:13 +0000 (18:13 -0700)]
Make stack manager functions not finish until action complete

It's a bit hacky at the moment, but this incremental update means the
stack manager booleans should be correct now and we can start removing
code that relies on the btif states.

9 years agos/async_result/future/g and also improve the future API
Zach Johnson [Fri, 19 Sep 2014 00:16:41 +0000 (17:16 -0700)]
s/async_result/future/g and also improve the future API

Freeing now happens implicitly upon await, and immediate
futures will allow a uniform usage pattern for calls
that are async and calls that are not.

9 years agoMake semaphore_free idempotent
Zach Johnson [Fri, 19 Sep 2014 00:29:54 +0000 (17:29 -0700)]
Make semaphore_free idempotent

Passing NULL before would lead to a segfault.

9 years agoMove all stack init/start_up/shut_down/clean_up on a single known thread
Zach Johnson [Tue, 9 Sep 2014 23:31:14 +0000 (16:31 -0700)]
Move all stack init/start_up/shut_down/clean_up on a single known thread

Execution happens on the same thread, but the next step will be to
ensure each of the functions do not complete until start_up/shut_down/clean_up
complete. That will ensure each is mutually exclusive.

9 years agoasync_result abstraction for signaling async return values
Zach Johnson [Wed, 10 Sep 2014 01:18:12 +0000 (18:18 -0700)]
async_result abstraction for signaling async return values

This will be useful when signaling success/fail during individual
asynchronous steps of stack start up and shut down.

9 years agoFix packet fragmenter so it doesn't request acl sizes unless it's actually an ACL...
Zach Johnson [Wed, 17 Sep 2014 22:20:04 +0000 (15:20 -0700)]
Fix packet fragmenter so it doesn't request acl sizes unless it's actually an ACL packet

During the startup process, commands are sent before the ACL sizes are fetched.
With the change that we now assert the acl sizes are fetched when you request
them from the controller, the assertion was being triggered during that phase.

When I was rebasing the waiting changes and also making the assertion change,
I should have been more careful to test this. mea culpa

Also simplifies that code path just a bit.

9 years agoShuffle HCI layer internal functions into a more logical ordering
Zach Johnson [Tue, 9 Sep 2014 01:53:52 +0000 (18:53 -0700)]
Shuffle HCI layer internal functions into a more logical ordering

No actual code additions/deletions, other than additional forward declarations

9 years agoRefactor bte_main into more of a shell.
Zach Johnson [Tue, 9 Sep 2014 01:31:39 +0000 (18:31 -0700)]
Refactor bte_main into more of a shell.

Moves all HCI initialization into hci_layer. Removes superfluous exposed
functionality on the HCI layer (like turning the chip on/off and logging)

Also reorganizes some of hci_layer to group related functions together.

9 years agoAdd non-repeating timer wrapper for alarm
Zach Johnson [Mon, 8 Sep 2014 22:20:22 +0000 (15:20 -0700)]
Add non-repeating timer wrapper for alarm

Refactor the hci layer to use it.

The timer wrapper allows you to specify the duration, etc at construction time
rather than at start time, making some usage patterns of alarm more convenient.

9 years agoHCI layer cleanup
Zach Johnson [Mon, 8 Sep 2014 16:56:35 +0000 (09:56 -0700)]
HCI layer cleanup

- x_interface_t started to get annoyingly verbose, changed to x_t
- buffer_allocator is standalone now, no longer part of bte_main
- new controller_t to handle controller start up and hold controller state
- new hci_packet_factory to make packets, and hci_packet_parser
  to read information out of packets.

9 years agoRemove must-always-be-true BTU_BTA_INCLUDED
Chris Manton [Wed, 3 Sep 2014 23:40:58 +0000 (16:40 -0700)]
Remove must-always-be-true BTU_BTA_INCLUDED

Change-Id: I7ddfb9d611b7f4a2787e0f4bec4a090cd9efc202

9 years agoAdd a check for a NULL root element from tinyxml2's XMLDocument.
Sharvil Nanavati [Tue, 16 Sep 2014 07:11:35 +0000 (00:11 -0700)]
Add a check for a NULL root element from tinyxml2's XMLDocument.

This shouldn't really be necessary since a parsed document
should have at least a root element. In practice, however, tinyxml2
sometimes returns success on LoadFile() and NULL on RootElement().

Bug: 17504829

9 years agoFix silly freeing of buffer.data instead of buffer
Zach Johnson [Tue, 16 Sep 2014 03:58:21 +0000 (20:58 -0700)]
Fix silly freeing of buffer.data instead of buffer

Also remove an unnecessary log message.

9 years agoSink all HCI transmission management into the HCI layer
Zach Johnson [Wed, 3 Sep 2014 21:36:44 +0000 (14:36 -0700)]
Sink all HCI transmission management into the HCI layer

Begins the refactoring of the HCI related code in BTA, corrects some
hacks in the HCI layer (no more concept of internal commands, yay!),
and corrects the handling of multiple commands pending response in the
HCI layer.

This introduce a horrible hack external to the HCI layer to keep BTU HCI
handling of command complete/status events on the BTU task. That hack
will be removed when BTU moves to a reactor model and we have osi
threads to work with.

9 years agoDemote timer hashmap entry failure log message
Chris Manton [Mon, 15 Sep 2014 16:46:58 +0000 (09:46 -0700)]
Demote timer hashmap entry failure log message

The procedures that use timers immediately cancel them upon startup
assuming they existed previously. The first time though the codepath
these traversalls cause the hashmap lookup failure.

9 years agobtif task removal and reactor insertion
Chris Manton [Mon, 8 Sep 2014 22:01:39 +0000 (15:01 -0700)]
btif task removal and reactor insertion

9 years agoGKI task entry points should have a consistent signature.
Sharvil Nanavati [Sun, 7 Sep 2014 09:48:19 +0000 (02:48 -0700)]
GKI task entry points should have a consistent signature.

Previously, GKI task entry points had inconsistent signatures. For
example, we had:

int btif_media_task(void *p)
void btif_task(UINT32 params)
void btu_task (UINT32 param)

The single argument was universally ignored and the caller always
set it to 0. This change consolidates all of that and defines the
entry point as having 0 arity and no return value.

9 years agoCode cleanup in GKI layer.
Sharvil Nanavati [Sun, 7 Sep 2014 09:15:19 +0000 (02:15 -0700)]
Code cleanup in GKI layer.

  * move buffer macros into .c from .h
  * delete dead code (e.g. GKI_igetpoolbuf, pool_list variable)
  * define task states as an enum and not a bitfield
  * start renaming fields in GKI control block for future consolidation

9 years agoEliminate unnecessary macros GKI_API, EXPORT_API, and UDRV_API.
Sharvil Nanavati [Sun, 7 Sep 2014 03:09:11 +0000 (20:09 -0700)]
Eliminate unnecessary macros GKI_API, EXPORT_API, and UDRV_API.

9 years agoDelete GKI debug code.
Sharvil Nanavati [Sun, 7 Sep 2014 02:49:20 +0000 (19:49 -0700)]
Delete GKI debug code.

GKI is slowly disappearing so much of that debug code isn't useful.

9 years agoEliminate GKI_os_malloc and GKI_os_free.
Sharvil Nanavati [Sun, 7 Sep 2014 02:42:22 +0000 (19:42 -0700)]
Eliminate GKI_os_malloc and GKI_os_free.

9 years agoEliminate unused variables bufpool{0..15} in GKI control block.
Sharvil Nanavati [Sun, 7 Sep 2014 01:55:43 +0000 (18:55 -0700)]
Eliminate unused variables bufpool{0..15} in GKI control block.

9 years agoGKI_USE_DEFERED_ALLOC_BUF_POOLS is always defined. Flatten code paths.
Sharvil Nanavati [Sun, 7 Sep 2014 01:42:48 +0000 (18:42 -0700)]
GKI_USE_DEFERED_ALLOC_BUF_POOLS is always defined. Flatten code paths.

9 years agoRemove unused fields from GKI internal header.
Sharvil Nanavati [Sun, 7 Sep 2014 01:31:03 +0000 (18:31 -0700)]
Remove unused fields from GKI internal header.

9 years agoCleanup and remove unused variables in GKI's common OS control block.
Sharvil Nanavati [Sun, 7 Sep 2014 01:17:55 +0000 (18:17 -0700)]
Cleanup and remove unused variables in GKI's common OS control block.

9 years agoUse arrays instead of variable names like Tmr0, Tmr1, ... in GKI.
Sharvil Nanavati [Sun, 7 Sep 2014 00:58:25 +0000 (17:58 -0700)]
Use arrays instead of variable names like Tmr0, Tmr1, ... in GKI.

9 years agoEliminate all attempts to set scheduling policy (all no-ops).
Sharvil Nanavati [Sat, 6 Sep 2014 23:53:25 +0000 (16:53 -0700)]
Eliminate all attempts to set scheduling policy (all no-ops).

9 years agoEliminate GKI_run and GKI_stop. Neither had any effect.
Sharvil Nanavati [Sat, 6 Sep 2014 23:46:46 +0000 (16:46 -0700)]
Eliminate GKI_run and GKI_stop. Neither had any effect.

GKI_run was called but didn't do anything: it would call
sched_setscheduler to increase the priority of the current process
but Android OS policy doesn't allow for that. And GKI_stop was never
called.

9 years agoEliminate always-on macro GKI_PTHREAD_JOINABLE.
Sharvil Nanavati [Sat, 6 Sep 2014 23:40:18 +0000 (16:40 -0700)]
Eliminate always-on macro GKI_PTHREAD_JOINABLE.

9 years agoEliminate unused 'stack' concept for GKI tasks.
Sharvil Nanavati [Sat, 6 Sep 2014 23:31:37 +0000 (16:31 -0700)]
Eliminate unused 'stack' concept for GKI tasks.

This change also fixes the type for task names: should be a const
string, not a mutable INT8*.

9 years agoMove BTU task creation into stack/btu/btu_init.c.
Sharvil Nanavati [Sat, 6 Sep 2014 23:16:19 +0000 (16:16 -0700)]
Move BTU task creation into stack/btu/btu_init.c.

Also fixed function naming where the BTE prefix was used
instead of BTU.

9 years agoReplace timers and btu_task
Chris Manton [Fri, 29 Aug 2014 16:12:06 +0000 (09:12 -0700)]
Replace timers and btu_task

Replace GKI timers with alarms.

9 years agoReplace mailboxes with fixed queues.
Chris Manton [Wed, 27 Aug 2014 17:30:47 +0000 (10:30 -0700)]
Replace mailboxes with fixed queues.

Also refactored btu_task a bit.

9 years agoRemove #define BTA_SYS_TIMER_PERIOD
Chris Manton [Thu, 28 Aug 2014 20:28:39 +0000 (13:28 -0700)]
Remove #define BTA_SYS_TIMER_PERIOD

9 years agoRemove unused BTU timer/event APIs
Chris Manton [Wed, 3 Sep 2014 18:04:36 +0000 (11:04 -0700)]
Remove unused BTU timer/event APIs

btu_register_timer
btu_deregister_timer
btu_register_event_range
btu_deregister_event_range

9 years agoFix memory leak in L2CAP utils
Sharvil Nanavati [Wed, 3 Sep 2014 05:15:37 +0000 (22:15 -0700)]
Fix memory leak in L2CAP utils

A list was not freed (just its contents was).

9 years agoReplace BUFFER_Q with list_t
Chris Manton [Tue, 5 Aug 2014 05:03:39 +0000 (22:03 -0700)]
Replace BUFFER_Q with list_t

9 years agoReplace A2DP BUFFER_Q with a list
Chris Manton [Tue, 5 Aug 2014 20:24:41 +0000 (13:24 -0700)]
Replace A2DP BUFFER_Q with a list

The functions acting upon this list are all executed from action
or event context; which would be the same thread.

9 years agoRemove unused function BTM_SecSetConnectFilterCallback
Zach Johnson [Tue, 2 Sep 2014 21:54:49 +0000 (14:54 -0700)]
Remove unused function BTM_SecSetConnectFilterCallback

9 years agoMake SCO sockets request eSCO instead of SCO
Zach Johnson [Tue, 16 Sep 2014 23:34:31 +0000 (16:34 -0700)]
Make SCO sockets request eSCO instead of SCO

This fixes some audio routing problems.

9 years agoFix memory leak in RFCOMM sockets where some lists were not being freed.
Sharvil Nanavati [Sat, 30 Aug 2014 01:26:23 +0000 (18:26 -0700)]
Fix memory leak in RFCOMM sockets where some lists were not being freed.

9 years agoRemove unused #define BTU_CMD_CMPL_TOUT_DOUBLE_CHECK
Chris Manton [Tue, 26 Aug 2014 17:35:35 +0000 (10:35 -0700)]
Remove unused #define BTU_CMD_CMPL_TOUT_DOUBLE_CHECK

9 years agoRemove unused definitions using GKI events
Chris Manton [Tue, 26 Aug 2014 17:21:12 +0000 (10:21 -0700)]
Remove unused definitions using GKI events

9 years agoRe-layout Android.mk for single shared library
Chris Manton [Wed, 7 May 2014 23:21:00 +0000 (16:21 -0700)]
Re-layout Android.mk for single shared library

9 years agoRemove unncessary socket write to SCO socket.
Sharvil Nanavati [Sat, 23 Aug 2014 00:13:22 +0000 (17:13 -0700)]
Remove unncessary socket write to SCO socket.

I've verified that the BluetoothSocket is terminated in a timely manner
even without the write(2).

9 years agoUpdate SCO sockets to use OSI.
Sharvil Nanavati [Fri, 22 Aug 2014 01:17:19 +0000 (18:17 -0700)]
Update SCO sockets to use OSI.

This change brings us one step closer to eliminating btsock_thread.

9 years agoRewrite the btif_sock module.
Sharvil Nanavati [Thu, 21 Aug 2014 20:17:43 +0000 (13:17 -0700)]
Rewrite the btif_sock module.

The initialization flow now handles errors. The btif_sock module is
now solely responsible for managing the lifetime of the btsock_thread
it creates.

This change lays the foundation for switching all btif sockets to use
the OSI primitives.

9 years agoImplement GKI timers in terms of alarm.c. This also fixes some alarm/wake lock bugs.
Sharvil Nanavati [Thu, 28 Aug 2014 04:30:59 +0000 (21:30 -0700)]
Implement GKI timers in terms of alarm.c. This also fixes some alarm/wake lock bugs.

The OS callout implementation expects only a single outstanding alarm
and a single wake lock being taken. Since alarm.c uses both and GKI
timers use both, they were occasionally clobbering each other resulting
in unpredictable behaviour. By writing GKI timers in terms of alarm.c,
this change addresses those bugs.

9 years agoRemove unused "file system" concept & friends
Zach Johnson [Fri, 5 Sep 2014 06:05:55 +0000 (23:05 -0700)]
Remove unused "file system" concept & friends

Not actually ever used in the code, beyond importing some
header files and not calling any of their functions.

9 years agoRemove Windows related macros
Zach Johnson [Fri, 5 Sep 2014 01:33:10 +0000 (18:33 -0700)]
Remove Windows related macros

9 years agoEliminate call out/in indirection in bta_sys
Zach Johnson [Fri, 5 Sep 2014 00:57:58 +0000 (17:57 -0700)]
Eliminate call out/in indirection in bta_sys

9 years agoRemove FM/GPS/NFC related definitions
Zach Johnson [Thu, 4 Sep 2014 20:45:06 +0000 (13:45 -0700)]
Remove FM/GPS/NFC related definitions

9 years agoMake the DURING test stub macro support checking multiple modes at a time
Zach Johnson [Thu, 4 Sep 2014 07:17:41 +0000 (00:17 -0700)]
Make the DURING test stub macro support checking multiple modes at a time

This allows test modes which have almost identical code paths to share
some test stub code instead of having to duplicate it for each of them.

9 years agoRemove _WIDCOMM defines and AMP VSE events from hcidefs.h
Zach Johnson [Tue, 2 Sep 2014 22:41:26 +0000 (15:41 -0700)]
Remove _WIDCOMM defines and AMP VSE events from hcidefs.h

9 years agoRemove some more unused Broadcom specific macros
Zach Johnson [Tue, 2 Sep 2014 23:31:43 +0000 (16:31 -0700)]
Remove some more unused Broadcom specific macros

9 years agoRemove BTM_ReadBrcmFeatures because it shouldn't exist and isn't used
Zach Johnson [Tue, 2 Sep 2014 23:18:33 +0000 (16:18 -0700)]
Remove BTM_ReadBrcmFeatures because it shouldn't exist and isn't used

Also eliminates some related macros.

9 years agoRemove the company id defines (except broadcom for now)
Zach Johnson [Tue, 2 Sep 2014 23:01:00 +0000 (16:01 -0700)]
Remove the company id defines (except broadcom for now)

9 years agoRemove printf when attempting SDP requests.
Sharvil Nanavati [Wed, 3 Sep 2014 04:29:48 +0000 (21:29 -0700)]
Remove printf when attempting SDP requests.

9 years agoImplement BTM_InqDbRead in terms of btm_inq_db_find
Zach Johnson [Tue, 2 Sep 2014 20:54:18 +0000 (13:54 -0700)]
Implement BTM_InqDbRead in terms of btm_inq_db_find

duplicated_code--;

9 years agoRemove never used function BTM_GetNumLeLinks
Zach Johnson [Tue, 2 Sep 2014 21:24:56 +0000 (14:24 -0700)]
Remove never used function BTM_GetNumLeLinks

verified unused, even in the latest android code

9 years agoModify allocation tracking to include and verify the allocation source
Zach Johnson [Sat, 30 Aug 2014 00:08:44 +0000 (17:08 -0700)]
Modify allocation tracking to include and verify the allocation source

This will help detect and prevent allocator alloc/free mismatch.

9 years agoAdd memory canaries and turn them on for unit tests
Zach Johnson [Thu, 28 Aug 2014 20:30:17 +0000 (13:30 -0700)]
Add memory canaries and turn them on for unit tests

This will allow us to verify with resonable certainty
that the code is not writing past the end or beginning
of the memory allocation that it was given.

With canaries on, the canaried pointers returned by the
osi alloc functions are no longer passable directly to
free, since they must be offset to get the real allocation
pointers. This means all legacy code must be converted
over to the osi alloc functions before turning canaries
on in the wider codebase.

9 years agoRemove unused function BTM_SetInquiryFilterCallback
Zach Johnson [Tue, 2 Sep 2014 18:49:55 +0000 (11:49 -0700)]
Remove unused function BTM_SetInquiryFilterCallback

9 years agoRemove unused function BTM_InquiryRegisterForChanges and associated code
Zach Johnson [Tue, 2 Sep 2014 18:42:09 +0000 (11:42 -0700)]
Remove unused function BTM_InquiryRegisterForChanges and associated code

9 years agoAdd a VALGRIND #define to heap-allocate all GKI buffers.
Sharvil Nanavati [Tue, 2 Sep 2014 17:53:46 +0000 (10:53 -0700)]
Add a VALGRIND #define to heap-allocate all GKI buffers.

This change allows us to run Valgrind on bluedroid to find memory
leaks. It has already been used to track down multiple memory leaks
which weren't trackable with the existing GKI buffer implementation.

9 years agoFix memory leak in BTU where enequeued buffers were never freed on shutdown.
Sharvil Nanavati [Sat, 30 Aug 2014 01:28:19 +0000 (18:28 -0700)]
Fix memory leak in BTU where enequeued buffers were never freed on shutdown.

This resulted in the stack running out of GKI buffers on repeated
enable/disable cycles.

9 years agoRename init/cleanup to start_up/shut_down in the HCI layer
Zach Johnson [Sat, 30 Aug 2014 01:20:48 +0000 (18:20 -0700)]
Rename init/cleanup to start_up/shut_down in the HCI layer

9 years agoDon't pass in uninitialized memory to epoll_ctl. Make valgrind happy.
Sharvil Nanavati [Fri, 29 Aug 2014 23:30:25 +0000 (16:30 -0700)]
Don't pass in uninitialized memory to epoll_ctl. Make valgrind happy.

9 years agoRemove incomplete FTP #defines and implementation
Zach Johnson [Fri, 29 Aug 2014 23:03:20 +0000 (16:03 -0700)]
Remove incomplete FTP #defines and implementation

9 years agoRemove unreferenced BTRC_DISP macro
Zach Johnson [Fri, 29 Aug 2014 21:57:53 +0000 (14:57 -0700)]
Remove unreferenced BTRC_DISP macro

9 years agoRemove unreferenced BTE macros
Zach Johnson [Fri, 29 Aug 2014 21:54:43 +0000 (14:54 -0700)]
Remove unreferenced BTE macros

9 years agoFix heap memory leak by placing the BT device struct in static storage
Sharvil Nanavati [Fri, 29 Aug 2014 22:39:56 +0000 (15:39 -0700)]
Fix heap memory leak by placing the BT device struct in static storage

9 years agoRemoved always false macro BTM_INQ_GET_REMOTE_NAME
Zach Johnson [Fri, 29 Aug 2014 21:05:36 +0000 (14:05 -0700)]
Removed always false macro BTM_INQ_GET_REMOTE_NAME

9 years agoRemove some never used BTM macros
Zach Johnson [Fri, 29 Aug 2014 20:57:21 +0000 (13:57 -0700)]
Remove some never used BTM macros

9 years agoRemove always false macro L2CAP_HOST_FLOW_CTRL
Zach Johnson [Fri, 29 Aug 2014 20:23:07 +0000 (13:23 -0700)]
Remove always false macro L2CAP_HOST_FLOW_CTRL

9 years agoRemove unused #define's BTM_IS_CONNECTABLE and BTM_IS_DISCOVERABLE
Zach Johnson [Fri, 29 Aug 2014 18:11:22 +0000 (11:11 -0700)]
Remove unused #define's BTM_IS_CONNECTABLE and BTM_IS_DISCOVERABLE

9 years agoEliminate unused #define BTM_INTERNAL_BB
Zach Johnson [Fri, 29 Aug 2014 05:09:14 +0000 (22:09 -0700)]
Eliminate unused #define BTM_INTERNAL_BB

9 years agoUse osi_free with osi_calloc in HCI layer to avoid corruption
Sharvil Nanavati [Fri, 29 Aug 2014 08:35:03 +0000 (01:35 -0700)]
Use osi_free with osi_calloc in HCI layer to avoid corruption

There was a mismatch where the free function was GKI_free for a
pointer allocated with osi_calloc. This resulted in GKI exceptions
being thrown if the adapter goes through enable -> disable -> enable
-> disable without terminating the process.

9 years agoRemove unused auto-reset code path, with associated macros.
Zach Johnson [Fri, 29 Aug 2014 04:42:39 +0000 (21:42 -0700)]
Remove unused auto-reset code path, with associated macros.

9 years agoRemove unused #define BTM_AFTER_RESET_TIMEOUT
Zach Johnson [Fri, 29 Aug 2014 04:25:04 +0000 (21:25 -0700)]
Remove unused #define BTM_AFTER_RESET_TIMEOUT

9 years agoRemove indirection in the controller reset sequence
Zach Johnson [Fri, 29 Aug 2014 00:05:08 +0000 (17:05 -0700)]
Remove indirection in the controller reset sequence

9 years agoFix issue where last character of device name is missing
Sharvil Nanavati [Thu, 28 Aug 2014 04:56:41 +0000 (21:56 -0700)]
Fix issue where last character of device name is missing

The device name stored on disk is correct but has a missing character
at the end when read off of disk. This happened because the returned
|length| parameter to |btif_config_get_str| is in number of *bytes*,
not in number of characters (i.e. must add one for NULL character).

9 years agoAdd a UUID module to btcore for operating on UUIDs.
Sharvil Nanavati [Thu, 28 Aug 2014 02:03:03 +0000 (19:03 -0700)]
Add a UUID module to btcore for operating on UUIDs.

This change only adds a single function, uuid_is_empty, but I expect
other UUID-related functions to find themselves here.

9 years agoIntroduce btcore, a low-level library to manipulate Bluetooth data types.
Sharvil Nanavati [Wed, 20 Aug 2014 16:39:25 +0000 (09:39 -0700)]
Introduce btcore, a low-level library to manipulate Bluetooth data types.

This change adds a single module to btcore: bdaddr. The bdaddr module
is reponsible for manipulating and working with Bluetooth addresses.

9 years agoFix digital transposition in saving binary config data
Zach Johnson [Thu, 21 Aug 2014 00:09:25 +0000 (17:09 -0700)]
Fix digital transposition in saving binary config data

Was causing link keys to be saved/read incorrectly, causing reconnect on reboot to fail.