mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
ipq5018: bt: fix hci cmd
Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org> Change-Id: Ideeec55d3fe062f1cdc07f81f379c017224dbf0c
This commit is contained in:
parent
276df92d06
commit
e98d1a5311
1 changed files with 13 additions and 7 deletions
|
|
@ -502,11 +502,16 @@ unsigned char set_interval[] =
|
|||
unsigned char start_beacon[] =
|
||||
{0x01, 0x0A, 0x20, 0x01, 0x01};
|
||||
|
||||
unsigned char *hci_cmds[] = {
|
||||
hci_reset,
|
||||
adv_data,
|
||||
set_interval,
|
||||
start_beacon
|
||||
struct hci_cmd{
|
||||
unsigned char* data;
|
||||
unsigned int len;
|
||||
};
|
||||
|
||||
struct hci_cmd hci_cmds[] = {
|
||||
{ hci_reset, sizeof(hci_reset) },
|
||||
{ adv_data, sizeof(adv_data) },
|
||||
{ set_interval, sizeof(set_interval) },
|
||||
{ start_beacon, sizeof(start_beacon) },
|
||||
};
|
||||
|
||||
int wait_for_bt_event(struct bt_descriptor *btDesc, u8 bt_wait)
|
||||
|
|
@ -594,10 +599,11 @@ static int initialize_nvm(struct bt_descriptor *btDesc,
|
|||
int send_bt_hci_cmds(struct bt_descriptor *btDesc)
|
||||
{
|
||||
int ret, i;
|
||||
int count = sizeof hci_cmds/ sizeof(unsigned char *);
|
||||
int count = sizeof hci_cmds/ sizeof(struct hci_cmd);
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
bt_ipc_sendmsg(btDesc, hci_cmds[i], sizeof hci_cmds[i]);
|
||||
bt_ipc_sendmsg(btDesc, hci_cmds[i].data, hci_cmds[i].len);
|
||||
|
||||
ret = wait_for_bt_event(btDesc, BT_WAIT_FOR_TX_COMPLETE);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue