BOOLEAN btsnd_hcic_ble_set_local_used_feat (UINT8 feat_set[8])
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_SET_USED_FEAT_CMD)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_SET_USED_FEAT_CMD;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_set_random_addr (BD_ADDR random_bda)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_RANDOM_ADDR_CMD)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_RANDOM_ADDR_CMD;
p->offset = 0;
UINT8 addr_type_dir, BD_ADDR direct_bda,
UINT8 channel_map, UINT8 adv_filter_policy)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_WRITE_ADV_PARAMS)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_WRITE_ADV_PARAMS ;
p->offset = 0;
}
BOOLEAN btsnd_hcic_ble_read_adv_chnl_tx_power (void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_READ_CMD)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_READ_CMD;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_set_adv_data (UINT8 data_len, UINT8 *p_data)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA + 1)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA + 1;
p->offset = 0;
}
BOOLEAN btsnd_hcic_ble_set_scan_rsp_data (UINT8 data_len, UINT8 *p_scan_rsp)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_WRITE_SCAN_RSP + 1)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_WRITE_SCAN_RSP + 1;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_set_adv_enable (UINT8 adv_enable)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_ADV_ENABLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_ADV_ENABLE;
p->offset = 0;
UINT16 scan_int, UINT16 scan_win,
UINT8 addr_type_own, UINT8 scan_filter_policy)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_WRITE_SCAN_PARAM)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_WRITE_SCAN_PARAM;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_set_scan_enable (UINT8 scan_enable, UINT8 duplicate)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_WRITE_SCAN_ENABLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_WRITE_SCAN_ENABLE;
p->offset = 0;
UINT16 conn_latency, UINT16 conn_timeout,
UINT16 min_ce_len, UINT16 max_ce_len)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_CREATE_LL_CONN)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_CREATE_LL_CONN;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_create_conn_cancel (void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_CREATE_CONN_CANCEL)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_CREATE_CONN_CANCEL;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_clear_white_list (void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CLEAR_WHITE_LIST)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CLEAR_WHITE_LIST;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_add_white_list (UINT8 addr_type, BD_ADDR bda)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_ADD_WHITE_LIST)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_ADD_WHITE_LIST;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_remove_from_white_list (UINT8 addr_type, BD_ADDR bda)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_REMOVE_WHITE_LIST)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_REMOVE_WHITE_LIST;
p->offset = 0;
UINT16 conn_latency, UINT16 conn_timeout,
UINT16 min_ce_len, UINT16 max_ce_len)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_UPD_LL_CONN_PARAMS)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_UPD_LL_CONN_PARAMS;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_set_host_chnl_class (UINT8 chnl_map[HCIC_BLE_CHNL_MAP_SIZE])
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_SET_HOST_CHNL_CLASS)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_SET_HOST_CHNL_CLASS;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_read_chnl_map (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_READ_CHNL_MAP)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_READ_CHNL_MAP;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_read_remote_feat (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_READ_REMOTE_FEAT)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_READ_REMOTE_FEAT;
p->offset = 0;
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 *) +
- HCIC_PARAM_SIZE_BLE_ENCRYPT)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_ENCRYPT;
p->offset = sizeof(void *);
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 *) +
- HCIC_PARAM_SIZE_BLE_RAND)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_RAND;
p->offset = sizeof(void *);
BOOLEAN btsnd_hcic_ble_start_enc (UINT16 handle, UINT8 rand[HCIC_BLE_RAND_DI_SIZE],
UINT16 ediv, UINT8 ltk[HCIC_BLE_ENCRYT_KEY_SIZE])
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_START_ENC)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_START_ENC;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_ltk_req_reply (UINT16 handle, UINT8 ltk[HCIC_BLE_ENCRYT_KEY_SIZE])
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_LTK_REQ_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_LTK_REQ_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_ltk_req_neg_reply (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_LTK_REQ_NEG_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_LTK_REQ_NEG_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_receiver_test(UINT8 rx_freq)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM1)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM1;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_transmitter_test(UINT8 tx_freq, UINT8 test_data_len, UINT8 payload)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM3)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM3;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_test_end(void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_READ_CMD)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_READ_CMD;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_read_host_supported (void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_READ_CMD)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_READ_CMD;
p->offset = 0;
UINT16 conn_latency, UINT16 conn_timeout,
UINT16 min_ce_len, UINT16 max_ce_len )
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_RC_PARAM_REQ_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_RC_PARAM_REQ_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_rc_param_req_neg_reply(UINT16 handle, UINT8 reason)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_RC_PARAM_REQ_NEG_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_RC_PARAM_REQ_NEG_REPLY;
p->offset = 0;
UINT8 irk_peer[HCIC_BLE_IRK_SIZE],
UINT8 irk_local[HCIC_BLE_IRK_SIZE])
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_ADD_DEV_RESOLVING_LIST)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_ADD_DEV_RESOLVING_LIST;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_rm_device_resolving_list (UINT8 addr_type_peer, BD_ADDR bda_peer)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_RM_DEV_RESOLVING_LIST)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_RM_DEV_RESOLVING_LIST;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_clear_resolving_list (void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_CLEAR_RESOLVING_LIST)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_CLEAR_RESOLVING_LIST;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_read_resolvable_addr_peer (UINT8 addr_type_peer, BD_ADDR bda_peer)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_READ_RESOLVABLE_ADDR_PEER)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_READ_RESOLVABLE_ADDR_PEER;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_read_resolvable_addr_local (UINT8 addr_type_peer, BD_ADDR bda_peer)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_READ_RESOLVABLE_ADDR_LOCAL)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_READ_RESOLVABLE_ADDR_LOCAL;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_set_addr_resolution_enable (UINT8 addr_resolution_enable)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_SET_ADDR_RESOLUTION_ENABLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_SET_ADDR_RESOLUTION_ENABLE;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_set_rand_priv_addr_timeout (UINT16 rpa_timout)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_SET_RAND_PRIV_ADDR_TIMOUT)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_SET_RAND_PRIV_ADDR_TIMOUT;
p->offset = 0;
BOOLEAN btsnd_hcic_ble_set_data_length(UINT16 conn_handle, UINT16 tx_octets, UINT16 tx_time)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_SET_DATA_LENGTH)) == NULL)
- return FALSE;
-
- pp = p->data;
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_SET_DATA_LENGTH;
p->offset = 0;
BOOLEAN btsnd_hcic_inquiry(const LAP inq_lap, UINT8 duration, UINT8 response_cnt)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_INQUIRY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_INQUIRY;
p->offset = 0;
BOOLEAN btsnd_hcic_inq_cancel(void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_INQ_CANCEL)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_INQ_CANCEL;
p->offset = 0;
BOOLEAN btsnd_hcic_per_inq_mode (UINT16 max_period, UINT16 min_period,
const LAP inq_lap, UINT8 duration, UINT8 response_cnt)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_PER_INQ_MODE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_PER_INQ_MODE;
p->offset = 0;
BOOLEAN btsnd_hcic_exit_per_inq (void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_EXIT_PER_INQ)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_EXIT_PER_INQ;
p->offset = 0;
UINT8 page_scan_rep_mode, UINT8 page_scan_mode,
UINT16 clock_offset, UINT8 allow_switch)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CREATE_CONN)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
#ifndef BT_10A
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CREATE_CONN;
BOOLEAN btsnd_hcic_disconnect (UINT16 handle, UINT8 reason)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_DISCONNECT)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_DISCONNECT;
p->offset = 0;
#if BTM_SCO_INCLUDED == TRUE
BOOLEAN btsnd_hcic_add_SCO_conn (UINT16 handle, UINT16 packet_types)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_ADD_SCO_CONN)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_ADD_SCO_CONN;
p->offset = 0;
BOOLEAN btsnd_hcic_create_conn_cancel(BD_ADDR dest)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CREATE_CONN_CANCEL)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CREATE_CONN_CANCEL;
p->offset = 0;
BOOLEAN btsnd_hcic_accept_conn (BD_ADDR dest, UINT8 role)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_ACCEPT_CONN)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_ACCEPT_CONN;
p->offset = 0;
BOOLEAN btsnd_hcic_reject_conn (BD_ADDR dest, UINT8 reason)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_REJECT_CONN)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_REJECT_CONN;
p->offset = 0;
BOOLEAN btsnd_hcic_link_key_req_reply (BD_ADDR bd_addr, LINK_KEY link_key)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_LINK_KEY_REQ_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_LINK_KEY_REQ_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_link_key_neg_reply (BD_ADDR bd_addr)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_LINK_KEY_NEG_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_LINK_KEY_NEG_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_pin_code_req_reply (BD_ADDR bd_addr, UINT8 pin_code_len,
PIN_CODE pin_code)
{
- BT_HDR *p;
- UINT8 *pp;
- int i;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_PIN_CODE_REQ_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
+ int i;
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_PIN_CODE_REQ_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_pin_code_neg_reply (BD_ADDR bd_addr)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_PIN_CODE_NEG_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_PIN_CODE_NEG_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_change_conn_type (UINT16 handle, UINT16 packet_types)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CHANGE_CONN_TYPE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CHANGE_CONN_TYPE;
p->offset = 0;
BOOLEAN btsnd_hcic_auth_request (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CMD_HANDLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CMD_HANDLE;
p->offset = 0;
BOOLEAN btsnd_hcic_set_conn_encrypt (UINT16 handle, BOOLEAN enable)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_SET_CONN_ENCRYPT)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_SET_CONN_ENCRYPT;
p->offset = 0;
BOOLEAN btsnd_hcic_rmt_name_req (BD_ADDR bd_addr, UINT8 page_scan_rep_mode,
UINT8 page_scan_mode, UINT16 clock_offset)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_RMT_NAME_REQ)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_RMT_NAME_REQ;
p->offset = 0;
BOOLEAN btsnd_hcic_rmt_name_req_cancel (BD_ADDR bd_addr)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_RMT_NAME_REQ_CANCEL)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_RMT_NAME_REQ_CANCEL;
p->offset = 0;
BOOLEAN btsnd_hcic_rmt_features_req (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CMD_HANDLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CMD_HANDLE;
p->offset = 0;
BOOLEAN btsnd_hcic_rmt_ext_features (UINT16 handle, UINT8 page_num)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_RMT_EXT_FEATURES)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_RMT_EXT_FEATURES;
p->offset = 0;
BOOLEAN btsnd_hcic_rmt_ver_req (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CMD_HANDLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CMD_HANDLE;
p->offset = 0;
BOOLEAN btsnd_hcic_read_rmt_clk_offset (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CMD_HANDLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CMD_HANDLE;
p->offset = 0;
BOOLEAN btsnd_hcic_read_lmp_handle (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CMD_HANDLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CMD_HANDLE;
p->offset = 0;
UINT32 rx_bw, UINT16 max_latency, UINT16 voice,
UINT8 retrans_effort, UINT16 packet_types)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_SETUP_ESCO)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_SETUP_ESCO;
p->offset = 0;
UINT16 content_fmt, UINT8 retrans_effort,
UINT16 packet_types)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_ACCEPT_ESCO)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_ACCEPT_ESCO;
p->offset = 0;
BOOLEAN btsnd_hcic_reject_esco_conn (BD_ADDR bd_addr, UINT8 reason)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_REJECT_ESCO)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_REJECT_ESCO;
p->offset = 0;
BOOLEAN btsnd_hcic_hold_mode (UINT16 handle, UINT16 max_hold_period,
UINT16 min_hold_period)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_HOLD_MODE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_HOLD_MODE;
p->offset = 0;
UINT16 min_sniff_period, UINT16 sniff_attempt,
UINT16 sniff_timeout)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_SNIFF_MODE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_SNIFF_MODE;
p->offset = 0;
BOOLEAN btsnd_hcic_exit_sniff_mode (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CMD_HANDLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CMD_HANDLE;
p->offset = 0;
BOOLEAN btsnd_hcic_park_mode (UINT16 handle, UINT16 beacon_max_interval,
UINT16 beacon_min_interval)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_PARK_MODE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_PARK_MODE;
p->offset = 0;
BOOLEAN btsnd_hcic_exit_park_mode (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CMD_HANDLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CMD_HANDLE;
p->offset = 0;
UINT32 token_rate, UINT32 peak, UINT32 latency,
UINT32 delay_var)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_QOS_SETUP)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_QOS_SETUP;
p->offset = 0;
BOOLEAN btsnd_hcic_switch_role (BD_ADDR bd_addr, UINT8 role)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_SWITCH_ROLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_SWITCH_ROLE;
p->offset = 0;
BOOLEAN btsnd_hcic_write_policy_set (UINT16 handle, UINT16 settings)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_POLICY_SET)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_POLICY_SET;
p->offset = 0;
BOOLEAN btsnd_hcic_write_def_policy_set (UINT16 settings)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_DEF_POLICY_SET)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_DEF_POLICY_SET;
p->offset = 0;
BOOLEAN btsnd_hcic_set_event_filter (UINT8 filt_type, UINT8 filt_cond_type,
UINT8 *filt_cond, UINT8 filt_cond_len)
{
- BT_HDR *p;
- UINT8 *pp;
-
- /* Use buffer large enough to hold all sizes in this command */
- if ((p = HCI_GET_CMD_BUF(2 + filt_cond_len)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->offset = 0;
BOOLEAN btsnd_hcic_write_pin_type (UINT8 type)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM1)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM1;
p->offset = 0;
BOOLEAN btsnd_hcic_delete_stored_key (BD_ADDR bd_addr, BOOLEAN delete_all_flag)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_DELETE_STORED_KEY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_DELETE_STORED_KEY;
p->offset = 0;
BOOLEAN btsnd_hcic_change_name (BD_NAME name)
{
- BT_HDR *p;
- UINT8 *pp;
- UINT16 len = strlen ((char *)name) + 1;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CHANGE_NAME)) == NULL)
- return (FALSE);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
+ UINT16 len = strlen((char *)name) + 1;
- pp = (UINT8 *)(p + 1);
memset(pp, 0, HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CHANGE_NAME);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CHANGE_NAME;
BOOLEAN btsnd_hcic_read_name (void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_READ_CMD)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_READ_CMD;
p->offset = 0;
BOOLEAN btsnd_hcic_write_page_tout (UINT16 timeout)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM2)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM2;
p->offset = 0;
BOOLEAN btsnd_hcic_write_scan_enable (UINT8 flag)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM1)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM1;
p->offset = 0;
BOOLEAN btsnd_hcic_write_pagescan_cfg(UINT16 interval, UINT16 window)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PAGESCAN_CFG)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PAGESCAN_CFG;
p->offset = 0;
BOOLEAN btsnd_hcic_write_inqscan_cfg(UINT16 interval, UINT16 window)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_INQSCAN_CFG)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_INQSCAN_CFG;
p->offset = 0;
BOOLEAN btsnd_hcic_write_auth_enable (UINT8 flag)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM1)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM1;
p->offset = 0;
BOOLEAN btsnd_hcic_write_dev_class(DEV_CLASS dev_class)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM3)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM3;
p->offset = 0;
BOOLEAN btsnd_hcic_write_voice_settings(UINT16 flags)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM2)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM2;
p->offset = 0;
BOOLEAN btsnd_hcic_write_auto_flush_tout (UINT16 handle, UINT16 tout)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_AUTO_FLUSH_TOUT)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_AUTO_FLUSH_TOUT;
p->offset = 0;
BOOLEAN btsnd_hcic_read_tx_power (UINT16 handle, UINT8 type)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_READ_TX_POWER)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_READ_TX_POWER;
p->offset = 0;
BOOLEAN btsnd_hcic_host_num_xmitted_pkts (UINT8 num_handles, UINT16 *handle,
UINT16 *num_pkts)
{
- BT_HDR *p;
- UINT8 *pp;
- int j;
-
- if ((p = HCI_GET_CMD_BUF(1 + (num_handles * 4))) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + 1 + (num_handles * 4);
p->offset = 0;
UINT8_TO_STREAM (pp, num_handles);
- for (j = 0; j < num_handles; j++)
- {
- UINT16_TO_STREAM (pp, handle[j]);
- UINT16_TO_STREAM (pp, num_pkts[j]);
+ for (int i = 0; i < num_handles; i++) {
+ UINT16_TO_STREAM(pp, handle[i]);
+ UINT16_TO_STREAM(pp, num_pkts[i]);
}
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
BOOLEAN btsnd_hcic_write_link_super_tout (UINT8 local_controller_id, UINT16 handle, UINT16 timeout)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_LINK_SUPER_TOUT)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_LINK_SUPER_TOUT;
p->offset = 0;
BOOLEAN btsnd_hcic_write_cur_iac_lap (UINT8 num_cur_iac, LAP * const iac_lap)
{
- BT_HDR *p;
- UINT8 *pp;
- int i;
-
- if ((p = HCI_GET_CMD_BUF(1 + (LAP_LEN * num_cur_iac))) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + 1 + (LAP_LEN * num_cur_iac);
p->offset = 0;
UINT8_TO_STREAM (pp, num_cur_iac);
- for (i = 0; i < num_cur_iac; i++)
+ for (int i = 0; i < num_cur_iac; i++)
LAP_TO_STREAM (pp, iac_lap[i]);
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
BOOLEAN btsnd_hcic_sniff_sub_rate(UINT16 handle, UINT16 max_lat,
UINT16 min_remote_lat, UINT16 min_local_lat)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_SNIFF_SUB_RATE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_SNIFF_SUB_RATE;
p->offset = 0;
BOOLEAN btsnd_hcic_io_cap_req_reply (BD_ADDR bd_addr, UINT8 capability,
UINT8 oob_present, UINT8 auth_req)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_IO_CAP_RESP)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_IO_CAP_RESP;
p->offset = 0;
BOOLEAN btsnd_hcic_io_cap_req_neg_reply (BD_ADDR bd_addr, UINT8 err_code)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_IO_CAP_NEG_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_IO_CAP_NEG_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_read_local_oob_data (void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_R_LOCAL_OOB)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_R_LOCAL_OOB;
p->offset = 0;
BOOLEAN btsnd_hcic_user_conf_reply (BD_ADDR bd_addr, BOOLEAN is_yes)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_UCONF_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_UCONF_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_user_passkey_reply (BD_ADDR bd_addr, UINT32 value)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_U_PKEY_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_U_PKEY_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_user_passkey_neg_reply (BD_ADDR bd_addr)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_U_PKEY_NEG_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_U_PKEY_NEG_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_rem_oob_reply (BD_ADDR bd_addr, UINT8 *p_c, UINT8 *p_r)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_REM_OOB_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_REM_OOB_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_rem_oob_neg_reply (BD_ADDR bd_addr)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_REM_OOB_NEG_REPLY)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_REM_OOB_NEG_REPLY;
p->offset = 0;
BOOLEAN btsnd_hcic_read_inq_tx_power (void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_R_TX_POWER)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_R_TX_POWER;
p->offset = 0;
BOOLEAN btsnd_hcic_send_keypress_notif (BD_ADDR bd_addr, UINT8 notif)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_SEND_KEYPRESS_NOTIF)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_SEND_KEYPRESS_NOTIF;
p->offset = 0;
#if L2CAP_NON_FLUSHABLE_PB_INCLUDED == TRUE
BOOLEAN btsnd_hcic_enhanced_flush (UINT16 handle, UINT8 packet_type)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_ENHANCED_FLUSH)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_ENHANCED_FLUSH;
p->offset = 0;
BOOLEAN btsnd_hcic_get_link_quality (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CMD_HANDLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CMD_HANDLE;
p->offset = 0;
BOOLEAN btsnd_hcic_read_rssi (UINT16 handle)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_CMD_HANDLE)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_CMD_HANDLE;
p->offset = 0;
BOOLEAN btsnd_hcic_enable_test_mode (void)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_READ_CMD)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_READ_CMD;
p->offset = 0;
BOOLEAN btsnd_hcic_write_inqscan_type (UINT8 type)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM1)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM1;
p->offset = 0;
BOOLEAN btsnd_hcic_write_inquiry_mode (UINT8 mode)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM1)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM1;
p->offset = 0;
BOOLEAN btsnd_hcic_write_pagescan_type (UINT8 type)
{
- BT_HDR *p;
- UINT8 *pp;
-
- if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_WRITE_PARAM1)) == NULL)
- return (FALSE);
-
- pp = (UINT8 *)(p + 1);
+ BT_HDR *p = (BT_HDR *)osi_malloc(HCI_CMD_BUF_SIZE);
+ UINT8 *pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM1;
p->offset = 0;