History log of /system/bt/stack/bnep/bnep_main.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5fe6f0cf6b223e3ed6be4912d55b3ed5b41ce0cd 06-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Removed checks for NULL returns after osi_calloc() / osi_malloc()

Removed explicit checks for NULL pointer returns after calls
to osi_calloc() and osi_malloc(), because those are not needed.
If the memory allocation fails, osi_calloc() and osi_malloc()
will trigger an assert.

Bug: 27048759
Change-Id: I2791eb2f69c08f991f8fcdef10e101a41568cd95
/system/bt/stack/bnep/bnep_main.c
abd70abb5e42c9431df94fe9d2c4a78a0d8d9af9 05-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Replaced osi_getbuf()/osi_freebuf() with osi_malloc()/osi_free()

Removed the alternative buffer allocation osi_getbuf() / osi_freebuf()
and use instead osi_malloc() / osi_free().

Correspondingly, replaced usage of osi_freebuf_and_reset()
with osi_free_and_reset().

Bug: 24914560
Change-Id: I7a9599ba7fa900321f087da684428133eb0ddd6b
/system/bt/stack/bnep/bnep_main.c
20524d393e8b3bea4c573f7980cd843500b0e6a4 03-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Refactor usage of osi_free() and osi_freebuf()

* Allow to call osi_freebuf(ptr) on NULL pointers. This simplifies
the code: a notable number of "if (foo != NULL)" checks are removed.
* Add new function osi_free_and_reset(p_ptr) that frees the buffer,
and explicitly resets the pointer to NULL.
This prevents unintended usage of free memory.
* Add corresponding function osi_freebuf_and_reset(p_ptr)
* Minor cleanup around usages of osi_free() and osi_freebuf()

Also:
* Removed unused function btif_gattc_cleanup()
* Replaced usage of the following functions with osi_freebuf_and_reset()
- mca_free_buf()
- utl_freebuf()
- btif_hl_free_buf()
* Replaced usage of rc_supported_event_free() with osi_freebuf()
* Replaced usage of btif_hl_get_buf() with osi_getbuf()
* Eliminate some of the osi_get_buf_size() calls

Bug: 22948224
Change-Id: Ife860658b26274da6f228d7353cb0f1531587337
/system/bt/stack/bnep/bnep_main.c
78bcff79e1b1f0efce436b33bdd6da88745bfc8a 05-Dec-2015 Pavlin Radoslavov <pavlin@google.com> Refactor the Bluetooth timers

* Updated the alarm API:
- Existing API alarm_new() is modified to take an alarm name
as an argument.
- New API alarm_new_periodic() is used to create a periodic
alarm.
- Added new API alarm_is_scheduled() to test whether an alarm is
scheduled.
- Existing API alarm_set_periodic() is removed: a periodic
alarm is created by alarm_new_periodic().
- Added new API alarm_set_on_queue() to set an alarm whose
callback is executed on a specific queue.
- Added new API alarm_register_processing_queue() and
alarm_unregister_processing_queue() to register/unregister
a queue and the corresponding thread for alarm processing.
- Added corresponding unit tests.

* Updated the alarm internals:
- Added alarm_info_t for collecting alarm-related information
and statistics.
- Collect and store alarm-related statistics into alarm_info_t
per alarm.
- Include the alarm-related statistics and info into the native
dumpsys output for Bluetooth.
- Once an alarm expires, the alarm execution is scheduled for
processing on another internal alarm-specific thread, not
on the thread that is maintaining the alarms.
- Implemented callback execution ordering guarantee among
timers on the same thread with exactly same timeout values.

* Refactor some of the usage of alarm_set() and simplify the
code by using alarm_set_on_queue() instead.

* Removed the non_repeating timers wrapper, and use directly
the alarm mechanism / API.

* Refactored all timer_entry_t timers and replaced them with alarm_t
timers:
- Replaced the btu_start_timer() / btu_stop_timer() /
btu_start_quick_timer() / btu_stop_quick_timer() /
btu_oneshot_alarm() mechanism with alarm_set_on_queue() and
alarm_cancel()
- Removed the whole mechanism around the BTU_TTYPE_* timers.

* Fixed a bug when processing the GATT indication confirmation timer
expiration (timer tGATT_TCB.conf_timer: b/26610829).

* Renamed and/or split misc. timeout functions, fields, and timers

* Renamed time-related constants and changed the values from seconds
to milliseconds

* Replaced timer tAVDT_CCB.timer_entry with three mutually exclusive timers:
idle_ccb_timer, ret_ccb_timer, rsp_ccb_timer
The reason we are using three timers, is because in the original code
function avdt_ccb_chk_timer() used the timer type in its logic: it
would stop the timer only if the type is "idle".

* Removed btm_ble_timeout() and replaced it with multiple timeout
callback functions (per timer)

* Fix the actual value of the global constant BT_1SEC_TIMEOUT and
rename it to BT_1SEC_TIMEOUT_MS

* Removed btu_cb and associated timers and events, because they are
never used.

* Removed unused timers, functions, struct and declarations that are
not used / needed.

Bug: 26611369
Bug: 26610829

Change-Id: I812c8c31710a5daefc58b01fcf35c353768f390f
/system/bt/stack/bnep/bnep_main.c
258c2538e3b62a8cdb403f2730c45d721e5292b4 28-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - moved GKI buffer allocation wrappers to OSI

* Moved the following GKI buffer allocation functions to OSI:
- GKI_getbuf() -> osi_getbuf()
- GKI_freebuf() -> osi_freebuf()
- GKI_get_buf_size() -> osi_get_buf_size()

For now we need the osi_getbuf() / osi_freebuf() allocation wrapper,
because we need to be able to call osi_get_buf_size() on the allocated
buffer.
In the future those should be replaced with osi_malloc() / osi_free().
Currently, the osi_malloc() buffer size internal allocation tracker
does not always track the size, hence we need the osi_getbuf() wrapper.

* Replaced GKI_MAX_BUF_SIZE with BT_DEFAULT_BUFFER_SIZE

* Added new file include/bt_common.h that can be usee to include
few files that should be included alost everywhere (e.g. bt_target.h"
NOTE: This file might be removed in the future and we should include
everywhere the right set of header files.

* Removed some of the GKI-related references

* Removed file include/gki_target.h

Change-Id: Ie87830e73143de200746d54235aa99f228a95024
/system/bt/stack/bnep/bnep_main.c
9f1c9ad85759c7663e3bbc494f8e75b2f107da67 28-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - Moved struct TIMER_LIST_ENT to OSI

* Moved struct TIMER_LIST_ENT to file osi/include/non_repeating_timer.h
and renamed it to timer_entry_t
NOTE: This is a short-term solution. timer_entry_t should be
removed, and its usage everywhere should be replaced by
struct non_repeating_timer_t .
* Renamed TIMER_CBACK to timer_callback_t
* Renamed TIMER_PARAM_TYPE to timer_param_t

Change-Id: I9ca830718bf900195f9c0a513a97f6995322693b
/system/bt/stack/bnep/bnep_main.c
1a3844f933bd63c8a381371dabfb35c6a0249e3e 25-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - Replaced usage of GKI queue with OSI fixed_queue

* Added new functions to OSI:
- fixed_queue_init()
- fixed_queue_length()
- fixed_queue_try_remove_from_queue()
- fixed_queue_try_peek_last()

* Renamed fixed_queue_try_peek() to fixed_queue_try_peek_first()

* Replaced usage of GKI queue functions with OSI fixed_queue functions:
- GKI_init_q() -> fixed_queue_new(SIZE_MAX)
NOTE: unlike GKI_init_q(), fixed_queue_new() allocates memory /
state that needs to be released by calling fixed_queue_free()
- GKI_enqueue() -> fixed_queue_enqueue()
- GKI_dequeue() -> fixed_queue_try_dequeue()
NOTE: fixed_queue_try_dequeue() is non-blocking
- GKI_queue_length() -> fixed_queue_length()
- GKI_queue_is_empty() -> fixed_queue_is_empty()
- GKI_getfirst() -> fixed_queue_try_peek_first()
- GKI_getlast() -> fixed_queue_try_peek_last()
- GKI_remove_from_queue() -> fixed_queue_try_remove_from_queue()
- Queue elements iteration.
In the fixed_queue implementation we have to use the underlying
list_t mechanism to iterate over the elements.
OLD:
p = GKI_getfirst(queue);
...
while ((p = GKI_getnext(p) != NULL) {
...
}
NEW:
list_t *list = fixed_queue_get_list(queue);
for (const list_node_t *node = list_begin(list);
node != list_end(list); node = list_next(node)) {
p = list_node(node);
}

* Remove initialization of the GKI module, because it is not needed
anymore

* Removed unused files in GKI:
gki/common/gki_common.h
gki/ulinux/gki_int.h
gki/ulinux/gki_ulinux.c

Change-Id: I3ff9464db75252d6faf7476a9ca67c88e535c51c
/system/bt/stack/bnep/bnep_main.c
6ba8fda60a9137a9f53f7e14edd87184610744fc 15-Oct-2014 Hemant Gupta <hemantg@codeaurora.org> Add proper checks for PAN & BNEP in BD stack

This patch fixes issues for PAN & BNEP in BD stack identified
by static analysis tool.

Change-Id: I29417dae982abb5cef11379f8d03baad11ffde8b
/system/bt/stack/bnep/bnep_main.c
f105417abd42ccdc3c36a154a86596d5aa5ae424 21-Jan-2015 Sharvil Nanavati <sharvil@google.com> Collapse BNEP #defines that don't need to be configurable.

In some instances, defining these macros to FALSE would result in
broken runtime behavior (e.g. UUID fields containing uninitialized
values). This change collapses the following defines:

BNEP_SUPPORTS_PROT_FILTERS
BNEP_SUPPORTS_MULTI_FILTERS
BNEP_SUPPORTS_DEBUG_DUMP
BNEP_SUPPORTS_ALL_UUID_LENGTHS
/system/bt/stack/bnep/bnep_main.c
79ecab5d0418fde77e9afcdd451bd713af73e180 31-Oct-2014 Chris Manton <cmanton@google.com> Move controller module to device directory
/system/bt/stack/bnep/bnep_main.c
f1c764fab01c929f71e185b97433bf40938026d3 24-Feb-2015 Sharvil Nanavati <sharvil@google.com> Make build more strict by adding more warning flags.

This change introduces -Wunused-but-set-variable to help catch
programming errors. It also undefines NDEBUG so assertions are
fatal and defines LOG_NDEBUG=1 to suppress LOGV.
/system/bt/stack/bnep/bnep_main.c
39110ec88460421618330863807804e03594ef67 06-Oct-2014 Zach Johnson <zachoverflow@google.com> Remove duplicate local bdaddr management functions
/system/bt/stack/bnep/bnep_main.c
d6e1b1ee17959461a80936f7308d8129615315d2 04-May-2014 Sharvil Nanavati <sharvil@google.com> Logging cleanup: HIDH, BNEP, and PAN.

Change-Id: I3b81b6875c764f0642be4f4d8905aa24524ea902
/system/bt/stack/bnep/bnep_main.c
5cd8bff2dd0337cb52bf48f312e3d2d55a8882fb 01-Feb-2014 Mike J. Chen <mjchen@google.com> Major warnings cleanup

Mostly fixing unused parameter warnings.
A few other warnings also fixed like possible use of
unitialized variables (no real issue found, just compiler couldn't
follow the path), signed vs unsigned warning.

Also fixed some typos, indent issues, removal of dead code, etc.

Change-Id: I95eb887aefc4d559d7921f71a0af5f3bfb01ac01
Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/bt/stack/bnep/bnep_main.c
5738f83aeb59361a0a2eda2460113f6dc9194271 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879baf

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/stack/bnep/bnep_main.c