History log of /system/bt/bta/hh/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
680959b0914cc32a4f30dbef2fcc95dd980dd96b 09-Jul-2015 Pavlin Radoslavov <pavlin@google.com> Add missing data initialization

A local struct variable is not initialized (memset to 0)
when sending GET_REPORT_EVT to an application.
As a result, field hs_data.rsp_data.p_rpt_data might be used
uninitialized.

Bug: 22352578
Change-Id: I72141117187c392bc0502a17bf71859e67c8da54
ta_hh_le.c
641e21a5389dd3765364f52a15a4a302a99fa360 12-Feb-2015 Subramanian Srinivasan <subrsrin@codeaurora.org> HOGP: Clear allocated memory for unmatched HID reports

Prevents GKI Exception in BT stack when phone enters suspended state
after performing HOGP device connection by clearing the allocated
memory when write to an unmatched report is done.

Bug: 22028876
Change-Id: Ia6ca9405142410e894c7ebe84d8827ffdc7659ba
ta_hh_le.c
b246a1a750c5a337faaa6033b39e78c8bdd4c2fb 10-Apr-2015 Prerepa Viswanadham <dham@google.com> Merge commit '4bf68bf020c7fd1aabcdc4b5d8f5fbb8bacdec9d' into merge_work

Change-Id: Ibc6d6e691b7f97611d16f96220346dfd6ffbbf52
4540f59bc447dc2b7b31a3e974b74a60b2417e7d 05-Feb-2015 VenkatRaghavan VijayaRaghavan <venkatrv@broadcom.com> Static code analysis cleanups and minor bug fixes

- Fix for initializing all the un-initialized variables
- Handling system call failure like socket,fcntl etc...
- In btpan_tap_close validate tap_if_down and close the socket.
- Invalid memset size, which could have potential memory issue
- Change -1 to INVALID_FD where appropriate

Bug: 19417758
Change-Id: Id31832f8678b2d72c80740c29b946a94e7ae0197
ta_hh_act.c
ta_hh_le.c
e1a9e52ff59d36bd1bb5b7b3a02fafba6394edfe 31-Mar-2015 Etan Cohen <etancohen@google.com> Merge commit 'f7f839985b3931682363d2ef3b7c5cae55a842ee' into merge

Change-Id: Iaaec1ea0bf3009b7e32a9a60f697631a3f56e889
0de22670c178b2e70c4d12ab94507d8f6b5a4f4d 10-Mar-2014 Nitin Arora <niarora@codeaurora.org> Fix macro for maximum allowed HOGP devices

This checks HOGP dev handle count less than or equal to maximum
allowed HOGP devices.

Change-Id: I63e6c3bc64a8c305b739b5eade0e846315e1ad1d
ta_hh_int.h
f8027005333c88a2f097cfd70d15c3d54c7764ae 12-Mar-2015 Chris Manton <cmanton@google.com> Demote, cleanup and extend observed logging
ta_hh_api.c
ta_hh_le.c
794f3b5f126fffc3dd1129a710187591348bbf23 01-Oct-2014 Chris Manton <cmanton@google.com> Removal of bd.[c|h]

Consolidate legacy types into bt_types.h
ta_hh_int.h
11cf5ccd5cd6dd1568bf69e4b6cbc27c95f5026d 11-Dec-2014 Chih-Hung Hsieh <chh@google.com> resolved conflicts for merge of ed0bdd42 to lmp-mr1-dev-plus-aosp

Change-Id: Ife8b72d3688ed78a95ccb8d5e0b60f40e7fec9e9
104e3f238f500cacdb8afaccdc672dfc34eae7ee 12-Nov-2014 Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org> Cleanups needed to make clang happy

This patch removes a slew of unused variables and some unused functions,
fixes some incomplete initializations of structs and an sprintf
parameter mismatching the format string.

Change-Id: I35f22fdccc8350f885cd357d3685b869224fa433
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
ta_hh_le.c
f37767a17b2d80828f7ac4fa170859cb9e2f0bc6 05-Nov-2014 Andre Eisenbach <eisenbach@google.com> HOGP: Do not remove device from whitelist on encryption failure

If the encryption times out during the re-connect process for a HOGP
device, the device is removed from the whitelist and thus will not
reconnect until it is added back to the list. On platforms that do not
have a way to reconnect to a device manually, this means the device will
never reconnect again until the stack is restarted.

This patch checks the reason for the encryption failure and does not
remove the device from the whitelist if the encryption failed to a non
authentication/key related error.

Bug: 18233442
Change-Id: Ifaec4a9224ff9281956715b38d34c2d7c3fecb01
ta_hh_int.h
ta_hh_le.c
433fe016392c7ae003033530f1b3994f2ddad313 17-Oct-2014 Chaojing Sun <cjsun@broadcom.com> Cache HOGP HID report map

HID reports from a bonded device can be missed when Bluetooth is
restarted HOGP report discovery is still active. Caching the
report information and loading it back when the stack resets
will ensure incoming HID reports can be processed immediately.

Bug: 17999991
Change-Id: I4608935f8749537d6b05625b894445a21f844ee0
ta_hh_int.h
ta_hh_le.c
d2246b6ebdc1db60c2db8dd0e34a3121a71117e9 29-Aug-2014 Priti Aghera <paghera@broadcom.com> LE: Remove stored link key if encryption fails due to missing key (remote)

Remove the link key if encryption fails due to missing key or
authentication error. When a remote device loses the bond, all
HOGP services cached should be discarded and all client configuration
descriptors needs to be re-enabled. This will ensure successful
re-connection.

Bug: 15022622
Change-Id: Ie1730830c0cbbc294e2cd579d7dca69d16cf8218
ta_hh_le.c
32cab09fbf90dd0a1ef787682c74acc64e0b93c3 30-Jul-2014 Mudumba Ananth <ananthm@broadcom.com> Added function headers.

-> Added function headers to bta_hh_le_read_battery_level_descr_cmpl
and bta_hh_le_find_service_inst_by_battery_inst_id.

Bug: 16560957

Change-Id: I1f9867f397e4bb4a848a42ac8547016e8b36898c
ta_hh_le.c
8942572fcb6efb0d68193d0892a11590559afa0f 04-Jul-2014 Mudumba Ananth <ananthm@broadcom.com> When HOGP reconnection fails, it will lose all cached HID report

When HOGP reconnection fails, it will lose all cached HID reports.
This will cause the following connection report all HID reports as
unknown reports, can not recover until rebond the device.
Make sure to remove cached reports only if open
fails during HID report discovery process.

Bug: 16560957
Change-Id: Ib23adad4a2721acabb5129779c0e9f2ff30d5e39
ta_hh_le.c
9b57f0802ec52f9169ebbd164c6f104724190ec1 25-Jul-2014 Adam Hampson <ahampson@google.com> Bluetooth: DIS: Only read the requested DIS characteristics

The BLE HID code only uses the PNP_ID characteristic from DIS.
Previously the DIS client would read all DIS characteristics
when a read request was made. This change allows the DIS user to
request certain DIS characteristics.

Bug: 16521059

Change-Id: I09c24718bb2e2da73c518b64c3cbdd07e7d6cf27
Signed-off-by: Adam Hampson <ahampson@google.com>
ta_hh_le.c
2772dac59971dd9c135cfac73a1ba77a912324f4 17-Jul-2014 Thomas.TT_Lin <Thomas.TT_Lin@htc.com> Bluetooth: fix the HOGP device(iBUFFALO BSMBB09DS) pair and reconnect problem.

in bta_hh_le.c (fix reconnect issue)
Since new LE security flags are import, (BTM_SEC_LE_AUTHENTICATED, BTM_SEC_LE_ENCRYPTED,
BTM_SEC_LE_NAME_KNOWN, BTM_SEC_LE_LINK_KEY_KNOWN, BTM_SEC_LE_LINK_KEY_AUTHED),
we have to use new BTM_GetSecurityFlagsByTransport() function with LE transport to get right sec_flag,
or will cause cannot correctly add to white list and cause reconnect fail.

in btif_dm.c (fix HOGP mouse pair issue)
the HOGP mouse will become abnormal if we update connection parameter too many times.
Therefore the is_hid case is not suitable for HOGP mouse,
it will trigger call to L2CA_EnableUpdateBleConnParams() several times due to service discovery and bonded state.
L2CA_EnableUpdateBleConnParams() update connection cause mouse abnormal.
The change will make the flow: complete bonding procedure first, then do service discovery, connect to mouse.

in gap_ble.c (fix HOGP device pair issue)
After pairing status is bonded, host start to create ATT layer to get some information from HOGP device.
If host send "disconnect" command during period. Device will stop to feedback anything.
Suggest to delete it.

in smp_act.c (fix HOGP device pair issue)
update connection parameter too many times may cause mouse abnormal,
so remove this code since this will be called again after service discovery.
Suggest to delete it.

Change-Id: I4b722343c2b08d33530bc6b928bc9ffe89fd09e9
Signed-off-by: Thomas.TT_Lin <Thomas.TT_Lin@htc.com>
ta_hh_le.c
afa6e1abbedaad8fe854b0f43999b8aeb801af91 28-Jun-2014 Matthew Xie <mattx@google.com> resolved conflicts for merge of e8c3d75b to master

Change-Id: I78ef69c4d54a36243620ae14296d3507e3339567
cf204828f72531bde5a62756bad80f643c010778 15-Nov-2013 Nitin Arora <niarora@codeaurora.org> LE: Use write_request to set HOGP descriptors

Use the write_request operation (instead of write_command) to set HOGP
descriptors in accordance with the Bluetooth spec.

Change-Id: I4c18f2cb727a7aabddaa5c965b29eca78843fc7a
ta_hh_le.c
011c658b876ea7ca0e0d4b77857dd7160687daad 26-Jun-2014 Mike J. Chen <mjchen@google.com> Fix bug with get report completion due to uninitialized structure

When LE has received a get report response, it needs to create
a packet to send to the btif_hh_upstreams_evt() handler that
does callback invocation. The packet it allocated was
not fully initialized. Specifically, the offset field was not
set, which is used by btif_hh_upstreams_evt() to figure out
where in the data buffer the start of the returned data is.
The uninitialized offset causes garbage to be returned for
anyone using GetReport/SetReport APIs on an LE device.

Change-Id: I4644cd8d6d38308c35b50f99139306a77200d7cd
Signed-off-by: Mike J. Chen <mjchen@google.com>
ta_hh_le.c
e8c3d75b75493911ebf0f99c83676359657178f7 04-May-2014 Sharvil Nanavati <sharvil@google.com> Logging cleanup: BTIF and APPL.

Change-Id: I5b1214642bbb4b9aecc0fd2c899a6ec2c9793286
ta_hh_act.c
ta_hh_api.c
ta_hh_le.c
ta_hh_main.c
ta_hh_utils.c
a14e2a014660460401a732abb017af1291ab89aa 06-Jun-2014 Sharvil Nanavati <sharvil@google.com> Eliminate dead code: remove GKI_sched* from the codebase.

Change-Id: I607bd3bf88ef8847c8a7e984a54eabedd4fb7516

Conflicts:
bta/hf_client/bta_hf_client_api.c
bta/hf_client/bta_hf_client_main.c
ta_hh_api.c
ta_hh_utils.c
82d0a118de082b95cc41b63de8fcd79c9f1f0831 06-Jun-2014 Sharvil Nanavati <sharvil@google.com> Eliminate dead code: remove GKI_sched* from the codebase.

Change-Id: I607bd3bf88ef8847c8a7e984a54eabedd4fb7516
ta_hh_api.c
ta_hh_utils.c
208dd40ad845d1ffa47ec142f764ea6df59aff19 19-May-2014 Mike J. Chen <mjchen@google.com> Change a TRACE_ERROR message to TRACE_DEBUG on every LE report

Change-Id: If07fdfb69dcfc0f9c983f9e4f42ee8d1bb615d1b
Signed-off-by: Mike J. Chen <mjchen@google.com>
ta_hh_le.c
7fa4fba6f59f97df00aff07dbe8fb21b114b3c2c 17-Apr-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Merge BT 4.1 features

The features include:
- LE Peripheral Mode
- Link Layer topology (LE Central & Peripheral Concurrency)
- Dual Mode Topology (Ability to choose LE transport when connecting with
other Dual Mode devices)
- Fast advertising Interval
- Limited Discovery Time Changes
- GAP Authentication and Lost Bond
- Dual Mode Addressing
- Common Profile and Service Error Code
- 32 bit UUIDs

Change-Id: Ic6701da4cf6aaa390ff2c8816b43157f36b7fb42

Conflicts:
stack/btu/btu_hcif.c
ta_hh_le.c
9e24c9b9f2d14e0f92fc36b5b9eeefcc82080fca 24-Nov-2013 Zhihai Xu <zhihaixu@google.com> HID: Fix memory leak in HID Code

This patch fixes memory leak in HID code when interrupt reports are
received from remote device before HID connection is setup.
CL from qcom(Hemant Gupta)

Change-Id: If4fe961921c7b1212035cf5f2aa60d2359e322e2
ta_hh_main.c
8fe58875ce67c6e1099e7ba2339dcd2b979491b0 17-Apr-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Merge BT 4.1 features

The features include:
- LE Peripheral Mode
- Link Layer topology (LE Central & Peripheral Concurrency)
- Dual Mode Topology (Ability to choose LE transport when connecting with
other Dual Mode devices)
- Fast advertising Interval
- Limited Discovery Time Changes
- GAP Authentication and Lost Bond
- Dual Mode Addressing
- Common Profile and Service Error Code
- 32 bit UUIDs

Change-Id: Ic6701da4cf6aaa390ff2c8816b43157f36b7fb42
ta_hh_le.c
2cba29af2ed1f642a8472d840a9015c41c10ec67 24-Nov-2013 Zhihai Xu <zhihaixu@google.com> HID: Fix memory leak in HID Code

This patch fixes memory leak in HID code when interrupt reports are
received from remote device before HID connection is setup.
CL from qcom(Hemant Gupta)

Change-Id: If4fe961921c7b1212035cf5f2aa60d2359e322e2
ta_hh_main.c
bf9a8aa26988aedbc161d75f2688641ce59dc001 11-Feb-2014 Mike J. Chen <mjchen@google.com> Fix warnings when BLE_INCLUDED is FALSE

Change-Id: I27c8ac6d5410159ed6bbef6aca5bf3b9692b0467
Signed-off-by: Mike J. Chen <mjchen@google.com>
ta_hh_utils.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>
ta_hh_act.c
ta_hh_api.c
ta_hh_le.c
2b12a21823fe6097ce473624ce582de5b4a58a0d 06-Jan-2014 Zhihai Xu <zhihaixu@google.com> Merge "read report array out of boundary for BLE HID device."
2711dc166eaf46453e4c240d3a7d89132f8e4ca1 19-Dec-2013 Zhihai Xu <zhihaixu@google.com> Merge "need to increase maximum number HID report for HOGP"
aac02e8b13fc516fa6a96e06a5687880f8086c26 18-Dec-2013 Zhihai Xu <zhihaixu@google.com> Can only support two HID report instance for BLE HID.

The follwoing code cause this problem:
BTA_HH_LE_RPT_INST_ID_MAP(s,c)=(UINT8)(((s)<<4)||(c))
The code use || instead of |, this cause we can only generate
two instance HID report 0 and 1(false and true).

bug:12213520
Change-Id: If6b7cfd9633255401aef12aafd918ee147f256b6
ta_hh_le.c
ac1d544eac1b849dd4105bd69e59ffeca00a43a6 19-Dec-2013 Zhihai Xu <zhihaixu@google.com> need to increase maximum number HID report for HOGP

The Mat mouse have more than 10 report (11),
which exceed our limitation

bug:12214036
Change-Id: Id578bf7959f73dc3bd57664eccf49ab5580ec76b
ta_hh_int.h
656792f010ac12c6e781d45d1f99216bcd23088f 18-Dec-2013 Zhihai Xu <zhihaixu@google.com> read report array out of boundary for BLE HID device.

report array out of boundary when read HID report reference
descriptor for BLE HID device.

bug:12208657
Change-Id: Ic60fd7555045f367b4fcd606510f52f60e36995e
ta_hh_le.c
9628abf10efe5df159f7ad4c192c3ef89fd7731c 16-Dec-2013 Zhihai Xu <zhihaixu@google.com> remove space.

bug: 10777562
Change-Id: I7560d4769dae2bc7b7796d0e7e133fa3cbd275c8
ta_hh_act.c
2a2701cdddac0859a95e58aec542742c450145b9 16-Sep-2013 Kim Schulz <k.schulz@samsung.com> Fixes for problems found with coverity analyzer

- fixed UNINITIALIZED variable (hdl) in bta_hh_act.c :220
- fixed possible RESOURCE LEAK in btif_config_util.cpp in relation to open_file_map() if file is fd size=0
- fixed possible RESOURCE LEAK in create_socket_server() in uipc:196 (s not closed)
- fixed possible OVERRUN in l2c_csm.c, (l2c_csm_config), array "l2cb.fixed_reg" of 4 20-byte elements at element index 60 (byte offset 1200) using index "p_ccb->local_cid - 3" (which evaluates to 60)
- fixed possible OVERRUN in btm_pm.c, (btm_pm_reset) array "btm_cb.acl_db" of 7 288-byte elements at element index 7 (byte offset 2016) using index "btm_cb.pm_pend_link" (which evaluates to 7).
- fixed possible OVERRUN in btif_storage.c, (btif_storage_add_device_to_autopair_blacklist) array "input_value" of 20 bytes by passing it to a function which accesses it at byte offset 20 using argument "20U".
patch set 2:
- fixed {}
Patch set 3:
- fixed review commment in stack/btm/btm_pm.c:379

bug: 10777562
Change-Id: I2a6d57f93acaaf9b25c49a6a29cb60d0e1e3c5d8
ta_hh_act.c
7051db3a486aae771d9b5a81c3546790f86ede34 13-Nov-2013 Zhihai Xu <zhihaixu@google.com> BLE HID device connection failure due to security error.

When HID BLE device start encryption, if some other GATT application
already start encryption(but not finished yet) by calling
gatt_security_check_start. The HID BLE device will be failed to start
encryption, which will cause it to disconnect the BLE HID connection.
The solution is to check whether we already started the encryption
, If the encryption is already started, wait until the encryption
finished, then continue to start security check for BLE HID device.
add encrytion complete event to notify all GATT client encryption done.
filter the event just for BTA HH LE GATT client.

bug:11636246
Change-Id: If58e57c623cc8cfa05208587b010bec68c71306c
ta_hh_int.h
ta_hh_le.c
ta_hh_main.c
bd68d683bce9e64bba6ac561e432da9d7bbab671 16-Nov-2013 Zhihai Xu <zhihaixu@google.com> Remove the device from le backgrond connection whitelist when it's unpaired

this is due to we didn't remove the device from the white list before unpair
Which cause a fake pair request from remote device triggered
right after the acl is disconnected.
The fix is to remove the BLE device from whitelist before unpair.
Also fix a problem return wrong device handle from bta_hh_le_add_device.

if bta_hh_le_add_device is called right after reboot, before we connect HID device.
This is normally true for a previous paired device, which we saved in the nvram.
The wrong device handle will cause the removing HID device from while list failed
after unpair the HID device.

bug:11676338
Change-Id: Id5b45b2829da9a990dfd1dbae0c15764b16c2bfb
ta_hh_le.c
ae003af6b43030d4059db29dee28e48bf0c6ea49 30-Sep-2013 Kim Schulz <k.schulz@samsung.com> fixed assignment with no effect

a variable was wrongfully assigned to itself insted.

Bug: 10998131
Change-Id: Ia563e9f8aa43e264a6664d81d917b7517e1c89b5
ta_hh_utils.c
dbba0e652e0ce23dd691df3c03979ec6e32c8db3 08-Nov-2013 Matthew Xie <mattx@google.com> Replace Broadcom proprietary license header with apache 2 header

bug 11591406

Change-Id: Ibb9c6b3865e6d757236f1c5896775bb6f28e47be
ta_hh_le.c
03d685233071eb9faa390f85869775d1058a0279 24-Oct-2013 Zhihai Xu <zhihaixu@google.com> Merge "Do not deregister HH GATT IF in bta_gattc_disable for hid over GATT" into klp-dev
36b686527892172cb44091d160b7d2806d49fc76 23-Oct-2013 Zhihai Xu <zhihaixu@google.com> Do not deregister HH GATT IF in bta_gattc_disable for hid over GATT

The root cause is bta_gattc_disable de-register the HH GATT IF
which cause bta_hh_cleanup_disable called
before we receive BTA_HH_INT_CLOSE_EVT.
The fix is "don't deregister HH GATT IF in bta_gattc_disable and
let HH module to de-register the HH GATT IF by bta_hh_le_deregister".
because HH GATT IF is a special GATT IF
which won't be exposed to uplayer and
HH GATT IF belong to BTA HH module, it should be managed by BTA HH.
bug:11284861

Change-Id: Ia14cd2be3f3548a4d1e2dcfbc89fa3a75d9651db
ta_hh_int.h
ta_hh_le.c
0ef5e93291bd4c6d8dedfd012cc27ee7c9b30c0d 22-Oct-2013 Andre Eisenbach <andre@broadcom.com> LE: Only prepend valid HID report IDs

If a remote HOGP device does not supply a valid report ID, do not
prepend it to the HID report.

This fixes interop issues with various LE mice, where the cursor would
not move on screen as expected.
BLTH02618447

Bug:11342157
Change-Id: I7832bb091654a5625f37b1531bd80fad9bbe6a51
ta_hh_le.c
fac9fef507d23c68c6160bf4d43a7b40111ca985 30-Sep-2013 Zhihai Xu <zhihaixu@google.com> Crash after unpairing BT keyboard

The crash is caused to access an array use invalid index value.
The solution is to check the index before access the array.
bug:10992001

Change-Id: Iad83764de9545fb2348105cf9cd9d32a85f1d654
ta_hh_main.c
da8b1f6ccc29e3ccdc07ccd3afd15b3671aa4c39 27-Aug-2013 Harish Paryani <hparyani@broadcom.com> Hid Host: Ensure Hid module is accepting events before processing

During shutdown sequence, Hid host module state machine was crashing
trying to process events in NULL state. Added the appropriate check.
bug 10429484
Change-Id: Ic8b8f61f2fa63027d3e473787cca6d4d221ec075
ta_hh_main.c
2e7fa68bfd9723b7ec7b6b0b128d89f31a2e06ee 09-Aug-2013 Andre Eisenbach <andre@broadcom.com> LE: Add support for the HID-over-GATT profile (1/3)

bug:8330048
Change-Id: I5727161b0a87700487bee96cdffa8fd169034204
ta_hh_act.c
ta_hh_api.c
ta_hh_int.h
ta_hh_le.c
ta_hh_main.c
ta_hh_utils.c
ead3cde4bac0c3e32cd31f149093f004eef8ceeb 06-Feb-2013 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Initial version of BLE support for Bluedroid

Change-Id: I9825a5cef9be2559c34c2a529b211b7d471147cf
ta_hh_act.c
ta_hh_api.c
ta_hh_cfg.c
ta_hh_int.h
ta_hh_main.c
ta_hh_utils.c
62b1414bcf9da45381ac2862aed405b641308f54 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot 0d153181bbe9ce75555b437567796a9aef4ef0ae

Change-Id: I99fb22bd2e10af658de4cfe26470e71bda147ce8
ta_hh_cfg.c
5738f83aeb59361a0a2eda2460113f6dc9194271 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879baf

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
ta_hh_act.c
ta_hh_api.c
ta_hh_cfg.c
ta_hh_int.h
ta_hh_main.c
ta_hh_utils.c