summaryrefslogtreecommitdiffstats
path: root/stack/hcic
diff options
context:
space:
mode:
authorAndre Eisenbach <andre@broadcom.com>2012-09-18 01:35:44 -0700
committerMatthew Xie <mattx@google.com>2012-09-18 16:26:28 -0700
commit6ef101187774e30ddba6b46bbedef549a42196ad (patch)
treef36eb347f03083671640fbc750171e3b951e0082 /stack/hcic
parentf80d3d045eab5f002be4b5e8a3d2d376fdf7581a (diff)
downloadexternal_bluetooth_bluedroid-6ef101187774e30ddba6b46bbedef549a42196ad.zip
external_bluetooth_bluedroid-6ef101187774e30ddba6b46bbedef549a42196ad.tar.gz
external_bluetooth_bluedroid-6ef101187774e30ddba6b46bbedef549a42196ad.tar.bz2
Initual Bluetooth open source release
First release under Apache source license with updated header files and whitespace cleanups. Also fixed file permission to remove executable bit from source files. Change-Id: I7155903edfc2f491c1cbbd0db108f207852caaa0
Diffstat (limited to 'stack/hcic')
-rw-r--r--stack/hcic/hciblecmds.c66
-rw-r--r--stack/hcic/hcicmds.c58
2 files changed, 74 insertions, 50 deletions
diff --git a/stack/hcic/hciblecmds.c b/stack/hcic/hciblecmds.c
index d491ca4..417297b 100644
--- a/stack/hcic/hciblecmds.c
+++ b/stack/hcic/hciblecmds.c
@@ -1,15 +1,27 @@
-/*****************************************************************************
-**
-** Name: hciblecmds.c
-**
-** Description: This file contains function of the HCIC unit to
-** format and send HCI commands.
-**
-**
-** Copyright (c) 1999-2008, Broadcom Corp., All Rights Reserved.
-** WIDCOMM Bluetooth Core. Proprietary and confidential.
-**
-******************************************************************************/
+/******************************************************************************
+ *
+ * Copyright (C) 1999-2012 Broadcom Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * This file contains function of the HCIC unit to format and send HCI
+ * commands.
+ *
+ ******************************************************************************/
#include "bt_target.h"
#include "gki.h"
@@ -148,7 +160,7 @@ BOOLEAN btsnd_hcic_ble_set_random_addr (BD_ADDR random_bda)
return (TRUE);
}
-BOOLEAN btsnd_hcic_ble_write_adv_params (UINT16 adv_int_min, UINT16 adv_int_max,
+BOOLEAN btsnd_hcic_ble_write_adv_params (UINT16 adv_int_min, UINT16 adv_int_max,
UINT8 adv_type, UINT8 addr_type_own,
UINT8 addr_type_dir, BD_ADDR direct_bda,
UINT8 channel_map, UINT8 adv_filter_policy)
@@ -252,7 +264,7 @@ BOOLEAN btsnd_hcic_ble_set_scan_rsp_data (UINT8 data_len, UINT8 *p_scan_rsp)
if (p_scan_rsp != NULL && data_len > 0)
{
- if (data_len > HCIC_PARAM_SIZE_BLE_WRITE_SCAN_RSP )
+ if (data_len > HCIC_PARAM_SIZE_BLE_WRITE_SCAN_RSP )
data_len = HCIC_PARAM_SIZE_BLE_WRITE_SCAN_RSP;
UINT8_TO_STREAM (pp, data_len);
@@ -286,8 +298,8 @@ BOOLEAN btsnd_hcic_ble_set_adv_enable (UINT8 adv_enable)
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
return (TRUE);
}
-BOOLEAN btsnd_hcic_ble_set_scan_params (UINT8 scan_type,
- UINT16 scan_int, UINT16 scan_win,
+BOOLEAN btsnd_hcic_ble_set_scan_params (UINT8 scan_type,
+ UINT16 scan_int, UINT16 scan_win,
UINT8 addr_type_own, UINT8 scan_filter_policy)
{
BT_HDR *p;
@@ -338,11 +350,11 @@ BOOLEAN btsnd_hcic_ble_set_scan_enable (UINT8 scan_enable, UINT8 duplicate)
}
/* link layer connection management commands */
-BOOLEAN btsnd_hcic_ble_create_ll_conn (UINT16 scan_int, UINT16 scan_win,
- UINT8 init_filter_policy,
- UINT8 addr_type_peer, BD_ADDR bda_peer,
+BOOLEAN btsnd_hcic_ble_create_ll_conn (UINT16 scan_int, UINT16 scan_win,
+ UINT8 init_filter_policy,
+ UINT8 addr_type_peer, BD_ADDR bda_peer,
UINT8 addr_type_own,
- UINT16 conn_int_min, UINT16 conn_int_max,
+ UINT16 conn_int_min, UINT16 conn_int_max,
UINT16 conn_latency, UINT16 conn_timeout,
UINT16 min_ce_len, UINT16 max_ce_len)
{
@@ -486,7 +498,7 @@ BOOLEAN btsnd_hcic_ble_remove_from_white_list (UINT8 addr_type, BD_ADDR bda)
return (TRUE);
}
-BOOLEAN btsnd_hcic_ble_upd_ll_conn_params (UINT16 handle,
+BOOLEAN btsnd_hcic_ble_upd_ll_conn_params (UINT16 handle,
UINT16 conn_int_min, UINT16 conn_int_max,
UINT16 conn_latency, UINT16 conn_timeout,
UINT16 min_ce_len, UINT16 max_ce_len)
@@ -585,14 +597,14 @@ BOOLEAN btsnd_hcic_ble_read_remote_feat (UINT16 handle)
}
/* security management commands */
-BOOLEAN btsnd_hcic_ble_encrypt (UINT8 *key, UINT8 key_len,
- UINT8 *plain_text, UINT8 pt_len,
+BOOLEAN btsnd_hcic_ble_encrypt (UINT8 *key, UINT8 key_len,
+ UINT8 *plain_text, UINT8 pt_len,
void *p_cmd_cplt_cback)
{
BT_HDR *p;
UINT8 *pp;
- if ((p = HCI_GET_CMD_BUF(sizeof(BT_HDR) + sizeof (void *) +
+ if ((p = HCI_GET_CMD_BUF(sizeof(BT_HDR) + sizeof (void *) +
HCIC_PARAM_SIZE_BLE_ENCRYPT)) == NULL)
return (FALSE);
@@ -603,7 +615,7 @@ BOOLEAN btsnd_hcic_ble_encrypt (UINT8 *key, UINT8 key_len,
*((void **)pp) = p_cmd_cplt_cback; /* Store command complete callback in buffer */
pp += sizeof(void *); /* Skip over callback pointer */
-
+
UINT16_TO_STREAM (pp, HCI_BLE_ENCRYPT);
UINT8_TO_STREAM (pp, HCIC_PARAM_SIZE_BLE_ENCRYPT);
@@ -612,7 +624,7 @@ BOOLEAN btsnd_hcic_ble_encrypt (UINT8 *key, UINT8 key_len,
if (key_len > HCIC_BLE_ENCRYT_KEY_SIZE) key_len = HCIC_BLE_ENCRYT_KEY_SIZE;
if (pt_len > HCIC_BLE_ENCRYT_KEY_SIZE) pt_len = HCIC_BLE_ENCRYT_KEY_SIZE;
-
+
ARRAY_TO_STREAM (pp, key, key_len);
pp += (HCIC_BLE_ENCRYT_KEY_SIZE - key_len);
ARRAY_TO_STREAM (pp, plain_text, pt_len);
@@ -626,7 +638,7 @@ BOOLEAN btsnd_hcic_ble_rand (void *p_cmd_cplt_cback)
BT_HDR *p;
UINT8 *pp;
- if ((p = HCI_GET_CMD_BUF(sizeof(BT_HDR) + sizeof (void *) +
+ if ((p = HCI_GET_CMD_BUF(sizeof(BT_HDR) + sizeof (void *) +
HCIC_PARAM_SIZE_BLE_RAND)) == NULL)
return (FALSE);
diff --git a/stack/hcic/hcicmds.c b/stack/hcic/hcicmds.c
index edc98a2..71a5dc5 100644
--- a/stack/hcic/hcicmds.c
+++ b/stack/hcic/hcicmds.c
@@ -1,15 +1,27 @@
-/*****************************************************************************
-**
-** Name: hcicmds.c
-**
-** Description: This file contains function of the HCIC unit to
-** format and send HCI commands.
-**
-**
-** Copyright (c) 1999-2011, Broadcom Corp., All Rights Reserved.
-** Broadcom Bluetooth Core. Proprietary and confidential.
-**
-******************************************************************************/
+/******************************************************************************
+ *
+ * Copyright (C) 1999-2012 Broadcom Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * This file contains function of the HCIC unit to format and send HCI
+ * commands.
+ *
+ ******************************************************************************/
#include "bt_target.h"
#include "gki.h"
@@ -71,7 +83,7 @@ BOOLEAN btsnd_hcic_inq_cancel(void)
return (TRUE);
}
-BOOLEAN btsnd_hcic_per_inq_mode (UINT16 max_period, UINT16 min_period,
+BOOLEAN btsnd_hcic_per_inq_mode (UINT16 max_period, UINT16 min_period,
const LAP inq_lap, UINT8 duration, UINT8 response_cnt)
{
BT_HDR *p;
@@ -325,7 +337,7 @@ BOOLEAN btsnd_hcic_link_key_neg_reply (BD_ADDR bd_addr)
return (TRUE);
}
-BOOLEAN btsnd_hcic_pin_code_req_reply (BD_ADDR bd_addr, UINT8 pin_code_len,
+BOOLEAN btsnd_hcic_pin_code_req_reply (BD_ADDR bd_addr, UINT8 pin_code_len,
PIN_CODE pin_code)
{
BT_HDR *p;
@@ -348,7 +360,7 @@ BOOLEAN btsnd_hcic_pin_code_req_reply (BD_ADDR bd_addr, UINT8 pin_code_len,
for (i = 0; i < pin_code_len; i++)
*pp++ = *pin_code++;
-
+
for (; i < PIN_CODE_LEN; i++)
*pp++ = 0;
@@ -793,7 +805,7 @@ BOOLEAN btsnd_hcic_sniff_mode (UINT16 handle, UINT16 max_sniff_period,
}
BOOLEAN btsnd_hcic_exit_sniff_mode (UINT16 handle)
-{
+{
BT_HDR *p;
UINT8 *pp;
@@ -840,7 +852,7 @@ BOOLEAN btsnd_hcic_park_mode (UINT16 handle, UINT16 beacon_max_interval,
}
BOOLEAN btsnd_hcic_exit_park_mode (UINT16 handle)
-{
+{
BT_HDR *p;
UINT8 *pp;
@@ -864,7 +876,7 @@ BOOLEAN btsnd_hcic_exit_park_mode (UINT16 handle)
BOOLEAN btsnd_hcic_qos_setup (UINT16 handle, UINT8 flags, UINT8 service_type,
UINT32 token_rate, UINT32 peak, UINT32 latency,
UINT32 delay_var)
-{
+{
BT_HDR *p;
UINT8 *pp;
@@ -1025,7 +1037,7 @@ BOOLEAN btsnd_hcic_flow_specification(UINT16 handle, UINT8 flags, UINT8 flow_dir
UINT8 service_type, UINT32 token_rate,
UINT32 token_bucket_size, UINT32 peak,
UINT32 latency)
-{
+{
BT_HDR *p;
UINT8 *pp;
@@ -1287,7 +1299,7 @@ BOOLEAN btsnd_hcic_read_stored_key (BD_ADDR bd_addr, BOOLEAN read_all_flag)
BOOLEAN btsnd_hcic_write_stored_key (UINT8 num_keys, BD_ADDR *bd_addr,
LINK_KEY *link_key)
-{
+{
BT_HDR *p;
UINT8 *pp;
int j;
@@ -1981,7 +1993,7 @@ BOOLEAN btsnd_hcic_set_host_flow_ctrl (UINT8 value)
return (TRUE);
}
-BOOLEAN btsnd_hcic_set_host_buf_size (UINT16 acl_len, UINT8 sco_len,
+BOOLEAN btsnd_hcic_set_host_buf_size (UINT16 acl_len, UINT8 sco_len,
UINT16 acl_num, UINT16 sco_num)
{
BT_HDR *p;
@@ -2237,9 +2249,9 @@ BOOLEAN btsnd_hcic_write_page_scan_mode (UINT8 mode)
*******************************************/
#if BTM_SSR_INCLUDED == TRUE
-BOOLEAN btsnd_hcic_sniff_sub_rate(UINT16 handle, UINT16 max_lat,
+BOOLEAN btsnd_hcic_sniff_sub_rate(UINT16 handle, UINT16 max_lat,
UINT16 min_remote_lat, UINT16 min_local_lat)
-{
+{
BT_HDR *p;
UINT8 *pp;